0

Я пользуюсь сборкой webpack при верстке, но файлы в продакшн минифицируются как это можно отменить? У меня есть скаченная сборка там в файле webpack.config.js (он один единственный config файл) вот такой код:

const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

module.exports ={
  // entry point
  entry: {
    app: './src/index.js'
  },
  //output point
  output: {
    filename: '[name].js',
    path: path.resolve(__dirname, './dist'),
    // for dev-server
    publicPath: '/dist'
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node-modules/,
        loader: 'babel-loader'
      },
      {
        test: /\.scss$/,
        use: [
          'style-loader',
          MiniCssExtractPlugin.loader,
          {
            loader: 'css-loader',
            options: { sourceMap: true }
          },
          {
            loader: 'postcss-loader',
            options: { sourceMap: true, config: {path: 'src/js/postcss.config.js'} }
          },
          {
            loader: 'sass-loader',
            options: { sourceMap: true }
          }
        ]
      },
      {
        test: /\.css$/,
        use: [
          'style-loader',
          MiniCssExtractPlugin.loader,
          {
            loader: 'css-loader',
            options: { sourceMap: true }
          },
          {
            loader: 'postcss-loader',
            options: { sourceMap: true, config: {path: 'src/js/postcss.config.js'} }
          }
        ]
      }
    ]
  },
  devServer: {
    // show errors in browser
    overlay: true,
    // cors error fixed
    // https://stackoverflow.com/questions/45575713/webpack-dev-server-cors-error-with-credentials
    headers: {
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
    }
  },
  plugins: [
    new MiniCssExtractPlugin({
      filename: '[name].css',
    }),
  ],
}

0

1 ответ 1

0
        optimization: {
            minimize: false
        },
        output: ...
0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.