求解:chunks:['main']不可用,chunks里边不管是定义一个main还是两个如['main','a']均不可用,报TypeError: Cannot read property 'entry' of undefined,使用excludeChunks:['a']的时候也是只可以定义一个,当两个的时候['a','main']或者三个的时候如['main','index','b']也是不行的报错和上边一样,但是可以写多个excludeChunks如excludeChunks:['a'],excludeChunks:['b']这样的时候程序认为是不引入b是覆盖?还是怎么求解
2017-04-27
这里要用webpack2.0的语法
传送门(中文文档):https://doc.webpack-china.org/loaders/babel-loader/
传送门(中文文档):https://doc.webpack-china.org/loaders/babel-loader/
2017-04-27
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output.path: The provided value "./dist/js" is not an absolute path!
一直报這个错 生成不了那个bundle.js,求指教
- configuration.output.path: The provided value "./dist/js" is not an absolute path!
一直报這个错 生成不了那个bundle.js,求指教
2017-04-26
删除本目录下的 package.json 和webpack.config.js npm install webpack --save 本地安装能解决 Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin' 这问题;
2017-04-26
webpack2.2 爬坑
...{test: /\.less$/,use: [ {loader:'style-loader'}, {loader:'css-loader',options:{importLoaders:1}}, {loader:'postcss-loader',options: {plugins: function () {return [require('autoprefixer')];}}},{loader:'less-loader'}],}...
...{test: /\.less$/,use: [ {loader:'style-loader'}, {loader:'css-loader',options:{importLoaders:1}}, {loader:'postcss-loader',options: {plugins: function () {return [require('autoprefixer')];}}},{loader:'less-loader'}],}...
2017-04-26
Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
2017-04-26
我来说说我是怎么解决了<% %>无效。在npm官网里面查询html-webpack-plugin发现有解决这个问题的文档。https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md。按照文档先下载了一个handlebars-loader插件,然后照里面所说的设置完成后,发现还是报错,原因是说这个插件未定义,之前我的插件是这样定义的 var webpackHtmlPlugin = require('html-webpack-plugin'),后来我把名字换成和老师一样的就好了,真是神奇。
2017-04-26