Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
- const path = require('path');
- module.exports = {
- mode: 'production',
- entry: './src/index.js',
- output: {
- filename: 'main.js',
- path: path.resolve(__dirname, 'dist/js'),
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: [['@babel/preset-env', {
- useBuiltIns: "usage",
- corejs: 3,
- modules: false
- }]]
- }
- }
- },
- {
- test: /\.(sa|sc|c)ss$/,
- exclude: /node_modules/,
- use: [
- MiniCssExtractPlugin.loader,
- {
- loader: 'css-loader',
- options: { url: false }
- },
- {
- loader: 'postcss-loader',
- options: {
- postcssOptions: {
- plugins: [ require('autoprefixer') ]
- }
- }
- },
- 'sass-loader'
- ]
- }
- ]
- },
- plugins: [
- new MiniCssExtractPlugin({
- filename: '../css/style.css',
- })
- ],
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement