我有以下webpack.config.js
var path = require("path");
var webpack = require('webpack');
module.exports = {
entry: {
'ng2-auto-complete': path.join(__dirname, 'src', 'index.ts')
},
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.html']
},
output: {
path: path.join(__dirname, 'dist'),
filename: "[name].umd.js",
library: ["[name]"],
libraryTarget: "umd"
},
externals: [
/^rxjs\//, //.... any other way? rx.umd.min.js does work?
/^@angular\//
],
devtool: 'source-map',
module: {
loaders: [
{ // Support for .ts files.
test: /\.ts$/,
loaders: ['ts', 'angular2-template-loader'],
exclude: [/test/, /node_modules\/(?!(ng2-.+))/]
}
]
}
};
Run Code Online (Sandbox Code Playgroud)
以及tsconfig.json
{
"compilerOptions": …Run Code Online (Sandbox Code Playgroud) 我正在尝试在项目上运行Webpack,我遇到了多个错误
node_modules/@types/core-js/index.d.ts
error TS2304: Cannot find name 'PropertyKey'.
...
node_modules/@types/core-js/index.d.ts
error TS2339: Property 'for' does not exist on type 'SymbolConstructor'.
Run Code Online (Sandbox Code Playgroud)
我应该安装所有的打字机,所以我不确定它们来自哪里.我尝试从一个编译的项目复制一个package.json,但它没有帮助.我错过了什么?
我的tsconfig看起来像这样
{
"compilerOptions": {
"target": "es5",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
Run Code Online (Sandbox Code Playgroud)