所以我想弄清楚如何使用webpack来取代我们当前的早午餐构建过程。基本上我们有一个角度1的应用程序,根本不利用需要或导入,我想让webpack只是concat + transile文件(有咖啡和sass文件和病态需要能够使用通常观看和创建源地图设置)。这个角度应用程序位于另一个广泛使用webpack的应用程序中。
实现这一目标的最简单方法是什么?如果没有使用任何形式的JavaScript模块的应用程序,这甚至可能吗?
这是我当前的配置:
var webpack = require( "webpack" );
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require("path");
var glob = require("glob");
const exportConfig = {
entry: {
app: glob.sync('./front-end/applications/core/app/**/*.coffee'),
vendor: ['angular']
},
output: {
filename: "app.bundle.js",
path: path.join( __dirname, "../www_root/build" ),
},
debug: true,
module: {
loaders: [
{
test: /\.coffee$/,
loader: "coffee-loader"
},
{
test: /\.sass$/,
loaders: ["style", "css", "sass"]
},
{
test: /\.(jsx|es6)/,
exclude: /(node_modules|www_root\/bower)/,
loader: "babel",
},
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js"),
new ExtractTextPlugin("[name].css", {
allChunks: true
}),
]
}
module.exports = exportConfig
我基本上只是得到一个输出文件,显然每个文件都有错误:
(function webpackMissingModule() { throw new Error("Cannot find module \"./front-end/applications/core/app/components/app/module.coffee\""); }());
谢谢!