我有这样的目录结构:
和node_modules内:
>node_modules
>./bin
>webpack.config.js
>bootstrap
>bootstrap.css
>bootstrap.js
Run Code Online (Sandbox Code Playgroud)
我需要像这样生成单独的CSS和JS包:
custom-styles.css,custom-js.js,style-libs.css,js-libs.js
where style-libs
和js-libs
should应该包含所有库的syles和js文件,如bootstrap和jQuery.这是我到目前为止所做的:
webpack.config.js:
const path = require('path');
const basedir = path.join(__dirname, '../../client');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const stylesPath = path.join(__dirname, '../bootstrap/dist/css');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
watch: true,
// Script to bundle using webpack
entry: path.join(basedir, 'src', 'Client.js'),
// Output directory and bundled file
output: {
path: path.join(basedir, 'dist'),
filename: 'app.js'
},
// Configure module loaders (for JS ES6, JSX, etc.)
module: {
// Babel …
Run Code Online (Sandbox Code Playgroud) 错误:
Uncaught Error: Cannot enable prod mode after platform setup. at main.bundle.js:1
Run Code Online (Sandbox Code Playgroud)
案件:
在使用生成构建之后,应用程序启动时出错ng build --prod
.但是,使用ng serve
或编译的开发构建ng build
工作正常.
我尝试了什么:
- 升级全局和本地@angular/cli
到最新版本,即1.6.0
遵循此答案.
的package.json:
{
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"auth0-js": "^8.11.3",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"jquery": "^3.2.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "^1.6.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2", …
Run Code Online (Sandbox Code Playgroud) 我正在开发一个简单的邮件应用程序,我需要获取消息正文。MSDN说,Office JavaScript API 1.1版本有对象属性,可以这样获取:body
message
Office.context.mailbox.item.body;
Run Code Online (Sandbox Code Playgroud)
但问题是我需要访问body
inread mode
和 MSDN 声明:
读取模式: body 属性未定义。
body
该财产为什么undefined
在read mode
以及我如何访问它?(如果可能的话)
webpack ×2
angular ×1
angular-cli ×1
angular5 ×1
asp.net ×1
asp.net-core ×1
office-js ×1
reactjs ×1
sitemap ×1
typescript ×1