为了账号安全,请及时绑定邮箱和手机立即绑定

课程里关于webpack的配置是低版本的,对高版本的不适用?

课程里关于webpack的配置是低版本的,对高版本的不适用?

正在回答

3 回答

说得很清楚啊,/Applications/Xcode6-Beta2.app/Contents/Developer这个位置找不到,beta3你改成beta3的目录就好了,不要告诉我你不知道哦怎么用3替换2.x100 = x1  (n - 1)*d

0 回复 有任何疑惑可以回复我~

这里的配置webpack4下是可以运行的

var htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    mode: 'development',
    entry: __dirname + '/src/app.js',
    output: {
        path: __dirname + "/dist",
        filename: "js/[name].bundle.js",
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: '/node_modules/',
                loader: "babel-loader"
            },
            {
                test: /\.css/,
                use: [
                    'style-loader',
                    'css-loader?importLoaders=1',
                    {
                        loader: 'postcss-loader',
                        options: {
                            plugins: [
                                require('autoprefixer')({
                                    browsers: [
                                        "last 10 version"
                                    ]
                                }),
                            ],
                        }
                    }
                ]
            },
            {
                test: /\.less$/,
                use: [
                    'style-loader',
                    'css-loader',
                    {
                        loader: 'postcss-loader',
                        options: {
                            plugins: [
                                require('autoprefixer')({
                                    browsers: [
                                        "last 10 version"
                                    ]
                                }),
                            ],
                        }
                    }, {
                        loader: "less-loader", options: {
                            sourceMap: true
                        }// compiles Less to CSS
                    }]
            },
            {
                test: /\.scss$/,
                use: [
                    "style-loader", // creates style nodes from JS strings
                    "css-loader",
                    {
                        loader: 'postcss-loader',
                        options: {
                            plugins: [
                                require('autoprefixer')({
                                    browsers: [
                                        "last 10 version"
                                    ]
                                }),
                            ],
                        }
                    },// translates CSS into CommonJS
                    "sass-loader" // compiles Sass to CSS, using Node Sass by default
                ]
            }
        ]
    },
    plugins: [
        new htmlWebpackPlugin({
            filename: 'index.html',
            template: './src/index.html',
            inject: 'body'
        })
    ]
}


1 回复 有任何疑惑可以回复我~

有的是适用的,只不过在安装的时候,需要局部安装一下

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

课程里关于webpack的配置是低版本的,对高版本的不适用?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信