我正在尝试从brunch.io切换到webpack,我想保持当前的布局如下:
到目前为止,我在index.html
和app.js
个文件中取得了成功,但我无法将dep/
文件夹中的文件连接到vendor.js
这是我的webpack.config文件:
var webpack, compileDir, jsEntryPoint, jadeEntryPoint;
require("shelljs/global");
webpack = require('webpack');
compileDir = "./build";
jsEntryPoint = "./src/client/init.ls";
jadeEntryPoint = "./src/client/static/index.jade";
echo("clear build directory");
rm('-rf', './build/*');
module.exports = {
entry: [jsEntryPoint, "file?name=" + compileDir + "/index.html!jade-html?with=pretty!" + jadeEntryPoint],
output: {
path: __dirname,
filename: compileDir + "/app.js"
},
module: {
loaders: [
{
test: /\.ls$/,
loader: 'livescript-loader'
}, {
test: /\.css$/,
loader: "style-loader!css-loader"
}
]
},
plugins: [new webpack.optimize.CommonsChunkPlugin("./src/dep", compileDir + "/vendor.js")],
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".js", ".ls"]
}
};
如何将dep/
文件夹中的所有文件连接到vendor.js
?