Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Changes]Comment setBabelrc() #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rushairer
Copy link

It's not necessary to set babelrc when use babel 7

It's not necessary to set babelrc when use babel 7
@hubcarl
Copy link
Collaborator

hubcarl commented Jul 11, 2019

Babel 7 处理是有些不同,这个我处理一下,目前设置后遇到什么问题不?

@rushairer
Copy link
Author

rushairer commented Jul 12, 2019

多谢回复。

贴一下我的config,好多loader得自己配,不知具体为何。
建议能否支持vue官方的vue-cli

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
                            }
                        },
                    }
                ]
            }
        }),
    },

@hubcarl
Copy link
Collaborator

hubcarl commented Dec 10, 2019

@rushairer 这些 loader 都不用配置

@rushairer
Copy link
Author

@hubcarl

多谢,后来我改掉config了,忘贴上来了。

webpack: {
            webpackConfigList: getWebpackConfig()
        },

@rushairer
Copy link
Author

@hubcarl

如果不注释掉这行,babel 7就会报错。
注释掉就可以使用babel 7了。

@hubcarl
Copy link
Collaborator

hubcarl commented Dec 13, 2019

@rushairer 我验证一下

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@ee5e69f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             master        #8   +/-   ##
==========================================
  Coverage          ?   100.00%           
==========================================
  Files             ?         3           
  Lines             ?        21           
  Branches          ?         0           
==========================================
  Hits              ?        21           
  Misses            ?         0           
  Partials          ?         0           
Impacted Files Coverage Δ
lib/base.js 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee5e69f...cd1bb88. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants