为什么webpack会更改它接触的所有文件权限?如何保持初始?

时间:2018-01-12 13:33:36

标签: webpack file-permissions

我开始使用webpack 3,似乎webpack进程触及的任何文件都更改为644(package.json,app.js,bundle.js等)

这是正常的吗?如果是这样,我该如何改变呢?

这是我的webpack配置文件内容:

const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
    entry: './src/app.js',
    output: {
        path: path.resolve(__dirname, './dist'),
        filename: 'bundle.js'
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/
            },
            {
                test: /\.scss$/,
                use: ExtractTextPlugin.extract({
                    fallback: 'style-loader',
                    use: [{
                            loader: 'css-loader',
                            options: {
                                minimize: true
                            }
                        },
                        'sass-loader'
                    ]
                })
            },
            {
                test: /\.(jpg|png|gif|svg)$/,
                use: [{
                        loader: "file-loader",
                        options: {
                            name: './[name]_[hash:5].[ext]',
                            useRelativePath : true
                        }
                    }
                ]
            }
        ]

    },
    plugins: [
        new ExtractTextPlugin('style.css')
    ]

};

提前致谢!

0 个答案:

没有答案