webpackを使用してangular 2アプリをセットアップしています。アプリを Internet Explorer 11 でサポートしたい。私のpackage.jsonで
"scripts": {
"build": "webpack --progress",
"build:prod": "webpack -p --progress --config=webpack.prod.config.js",
"postinstall": "typings install",
"local": "webpack-dev-server --inline --progress --port 3000",
"tslint": "tslint -c tslint.json src/app/**/*.ts"
},
"dependencies": {
"@angular/common": "^2.4.8",
"@angular/compiler": "^2.4.8",
"@angular/core": "^2.4.8",
"@angular/forms": "^2.4.8",
"@angular/http": "^2.4.8",
"@angular/platform-browser": "^2.4.8",
"@angular/platform-browser-dynamic": "^2.4.8",
"@angular/router": "^3.4.8",
"angular2-cool-storage": "1.2.1",
"angular2-highcharts": "^0.4.1",
"core-js": "^2.4.1",
"json-loader": "^0.5.4",
"lodash": "^4.16.3",
"moment": "^2.17.1",
"moment-timezone": "^0.5.13",
"ng2-slimscroll": "1.2.1",
"ngx-clipboard": "^5.1.0",
"ngx-tooltip": "0.0.9",
"ngx-uploader": "^2.2.8",
"reflect-metadata": "^0.1.8",
"rxjs": "^5.2.0",
"web-animations-js": "^2.2.5",
"zone.js": "^0.7.7"
},
"repository": {},
"devDependencies": {
"@types/node": "^6.0.53",
"angular2-template-loader": "^0.6.0",
"codelyzer": "2.0.0-beta.4",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"html-webpack-plugin": "^2.24.1",
"raw-loader": "^0.5.1",
"retyped-gapi.auth2-tsd-ambient": "0.0.0-1",
"style-loader": "^0.13.1",
"ts-loader": "2.2.2",
"tslint": "4.5.1",
"typescript": "^2.0.10",
"typings": "^2.1.0",
"webpack": "^1.14.0",
"webpack-dev-server": "^1.16.2"
}
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules/*",
"**/*-aot.ts"
]
}
webpack.config.json
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './src/main.ts',
output: {
path: './dist',
filename: 'app.bundle.js'
},
devServer: { //Only required for development environment
historyApiFallback:true,
stats: 'minimal'
},
devtool:'source-map', //Only required for development environment
module: {
loaders: [
{test: /\.css$/, loader: 'raw', exclude: /node_modules/},
{test: /\.css$/, loader: 'style!css?-minimize', exclude: /src/},
{test: /\.html$/, loader: 'raw'},
{test:/\.ts$/, loader: 'ts-loader!angular2-template-loader'},
{include: /\.json$/, loaders: ["json-loader"]}
]
},
resolve: {
extensions: ['','.js','.ts', '.json']
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html'
}),
new CopyWebpackPlugin([
{ from: 'static' }
])
]
}
コンソールウィンドウのエラーは
SCRIPT5022: エラー: PlanningComponent のすべてのパラメーターを解決できません: ([オブジェクト オブジェクト]、[オブジェクト オブジェクト]、?、[オブジェクト オブジェクト])。
オプションのパラメータに問題があります。また、Sのような他のエラーをスローすることもあります
CRIPT1028: 予想される識別子、文字列、または数値
しかし、他のブラウザでは発生していません。