0
我的Webpack將我的所有項目編譯成一個index.js。我能做些什麼來獲得「index.js」中的JavaScript代碼和「style/index.css」中的CSS代碼? 我的webpack.config.js:我能做些什麼來獲得webpack的輸出文件
`
var path = require('path');
module.exports = {
entry: './entry.js',
output: {
filename: 'testApp/www/index.js'
},
resolve: {
extensions: ['.js', '.jsx', '.json']
},
module: {
loaders: [
{ test: /\.jsx?$/,
loader: 'babel-loader',
include: path.resolve(__dirname,` "app"),
query:
{
presets:['react', 'es2015', 'stage-0']
}
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
}
]
}
};
`
您需要使用提取文本的WebPack插件:https://github.com/webpack-contrib/extract -text-的WebPack-插件/斑點/的WebPack-1/README.md –