你有一个块映射到/ cart / route,当我尝试加载它时,chrome throws
Not allowed to load local resource: file:///D:/MyProject/dist/js0.chunk.js
错误。
除此之外,路径不应该是file:///D:/MyProject/dist/js/0.chunk.js
?
这是我的webpack.config.js
const path = require('path');
module.exports = {
cache: true,
entry: './src/ts/main.ts',
output: {
path: path.resolve(__dirname, './dist/js/'),
publicPath: path.resolve(__dirname, './dist/js/'),
filename: '[name].bundle.js',
chunkFilename: '[id].chunk.js'
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
loaders: [{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular-router-loader']
},
{
test: /\.scss$/,
loader: "css-loader!sass-loader"
}
]
},
devServer: {
contentBase: './dist'
}
};