Javascript 源地图不';我不能狼吞虎咽地使用咖啡脚本和网页包
我正在用coffeescript编写一个应用程序,并使用gulp构建前端。我当前的开发版本如下所示Javascript 源地图不';我不能狼吞虎咽地使用咖啡脚本和网页包,javascript,coffeescript,gulp,webpack,source-maps,Javascript,Coffeescript,Gulp,Webpack,Source Maps,我正在用coffeescript编写一个应用程序,并使用gulp构建前端。我当前的开发版本如下所示 gulp.task 'coffee', -> gulp.src('./coffee/*.coffee') .pipe do plumber .pipe sourcemaps.init() .pipe coffee bare: true .pipe sourcemaps.write() .pipe gulp
gulp.task 'coffee', ->
gulp.src('./coffee/*.coffee')
.pipe do plumber
.pipe sourcemaps.init()
.pipe coffee bare: true
.pipe sourcemaps.write()
.pipe gulp.dest './pre-js/'
gulp.task 'webpack', ['coffee'], ->
return gulp.src('pre-js/main.js')
.pipe webpack require './webpack.config.js'
.pipe gulp.dest 'dist/js/'
module.exports = {
entry: "./pre-js/main.js",
output: {
path: __dirname,
filename: "main.js"
},
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" }
]
},
target: "web"
};
目前在coffee
目录中,我只有两个文件main.coffee
和style.coffee
,我的webpack.config如下所示
gulp.task 'coffee', ->
gulp.src('./coffee/*.coffee')
.pipe do plumber
.pipe sourcemaps.init()
.pipe coffee bare: true
.pipe sourcemaps.write()
.pipe gulp.dest './pre-js/'
gulp.task 'webpack', ['coffee'], ->
return gulp.src('pre-js/main.js')
.pipe webpack require './webpack.config.js'
.pipe gulp.dest 'dist/js/'
module.exports = {
entry: "./pre-js/main.js",
output: {
path: __dirname,
filename: "main.js"
},
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" }
]
},
target: "web"
};
在我添加webpack之前,我的sourcemaps工作正常,我可以轻松地从控制台跟踪所有内容。一旦我添加了webpack,所有console.log都指向style.coffee
。我注意到在这一点上没有发生缩小
如何修复构建过程以继续编写模块化应用程序,同时能够使用sourcemaps的优点?网页包配置文件中缺少的devtool:“源地图”
,网页包配置文件中缺少的devtool:“源地图”缺少的devtool:“源地图”
在网页包配置文件中缺少devtool:“源地图”
在网页包配置文件中