随便附上webpack中文官网的地址:
https://webpack.docschina.org/loaders/babel-loader
可以跑起来
不用谢,我是好人,(#^.^#)
https://webpack.docschina.org/loaders/babel-loader
可以跑起来
不用谢,我是好人,(#^.^#)
2018-05-21
目前使用的webpack的版本是4.8.3,而在webpack.config.js中的配置如下,
module:{
rules:[
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
}
]
},
我参考的是webpack的中文官网
module:{
rules:[
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
}
]
},
我参考的是webpack的中文官网
2018-05-21
之前是全局安装的webpack,所以安装html-webpack-glugin,运行时会报错
Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
解决的方法就是重新再当前的文件夹下,在局部安装一下,搞定
$ cnpm install webpack --save-dev
这里的cnpm我使用的是淘宝的镜像
Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
解决的方法就是重新再当前的文件夹下,在局部安装一下,搞定
$ cnpm install webpack --save-dev
这里的cnpm我使用的是淘宝的镜像
2018-05-21
最新回答 / 慕码人6895947
webpack ./src/main.js ./dist/bundle.jswebpack : 无法将“webpack”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。所在位置 行:1 字符: 1+ webpack ./src/main.js ./dist/bundle.js+ ~~~~~~~ + CategoryInfo : ObjectNotFound: (webpack:String) [], Comm...
2018-05-18
有没有同学和我一样,用webpack^4.8.1,哈哈踩坑无数,
这个autoprefixer 我时按照官网中的说法
要创建一个 postcss.config.js 才阔以
这个autoprefixer 我时按照官网中的说法
要创建一个 postcss.config.js 才阔以
2018-05-16
3.x
"webpack":"webpack --config webpack.config.js --progress --display-modules --colors --display-reasons"
加s
"webpack":"webpack --config webpack.config.js --progress --display-modules --colors --display-reasons"
加s
2018-05-15
exclude: path.resolve(__dirname, 'node_modules'),
include:/\.src/
这样比两个都用path.resolve速度快上10ms
include:/\.src/
这样比两个都用path.resolve速度快上10ms
2018-05-15
老师的额这个课程用的webpack版本是1.0,目前4.0的版本,从安装到配置 好多都不一样的,这个modue我是这样写的:
module:{
rules:[
{
test:/\.js$/,
exclude: __dirname + '/node_modules/',
use: {
loader: 'babel-loader',
options: {
presets: ["latest"]
}
}
}
]
}
module:{
rules:[
{
test:/\.js$/,
exclude: __dirname + '/node_modules/',
use: {
loader: 'babel-loader',
options: {
presets: ["latest"]
}
}
}
]
}
2018-05-14
1:我用的webpack 4.8.1运行webpack hello.js hello.bundle.js的时候提示错误,如下:
ERROR in multi ./hello.js hello.bundle.js
Module not found: Error: Can't resolve 'hello.bundle.js' in 'D:\learingFile\webpackLearning\day01'
@ multi ./hello.js hello.bundle.js
猜测可能是webpack的解析机制改了,把后面那个参数认为是一个模块,需要npm来安装这个模块导致的。
ERROR in multi ./hello.js hello.bundle.js
Module not found: Error: Can't resolve 'hello.bundle.js' in 'D:\learingFile\webpackLearning\day01'
@ multi ./hello.js hello.bundle.js
猜测可能是webpack的解析机制改了,把后面那个参数认为是一个模块,需要npm来安装这个模块导致的。
2018-05-10