-
Notifications
You must be signed in to change notification settings - Fork 10
[Changes]Comment setBabelrc() #8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
It's not necessary to set babelrc when use babel 7
Babel 7 处理是有些不同,这个我处理一下,目前设置后遇到什么问题不? |
多谢回复。 贴一下我的config,好多loader得自己配,不知具体为何。 webpack: {
webpackConfigList: getWebpackConfig({
target: 'web',
entry: 'app/vue/src/main.js',
plugins: {
extract: true,
imagemini: false,
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': path.join(__dirname , '../app/vue/src')
}
},
module: {
rules: [
{
test: /\.vue$/,
use: [
'vue-loader',
]
},
{
test:/\.css$/,
use:[
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: () => [require('autoprefixer')],
}
},
'sass-loader',
]
},
{
test:/\.(png|gif|jpg|svg)$/,
use:[
'file-loader',
]
},
{
test: /\.scss$/,
use:[
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: () => [require('autoprefixer')],
}
},
'sass-loader',
],
},
{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
'@vue/app',
],
plugins: [
'babel-plugin-espower',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-object-assign',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-transform-runtime',
[
'component',
{
'libraryName': 'element-ui',
'styleLibraryName': 'theme-chalk'
}
]
],
comments: true
}
},
}
]
}
}),
}, |
@rushairer 这些 loader 都不用配置 |
多谢,后来我改掉config了,忘贴上来了。
|
如果不注释掉这行,babel 7就会报错。 |
@rushairer 我验证一下 |
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 3
Lines ? 21
Branches ? 0
==========================================
Hits ? 21
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
It's not necessary to set babelrc when use babel 7