UNPKG

electrojet-scripts

Version:

Build scripts for use with create-electrojet

60 lines (58 loc) 1.27 kB
const webpack = require('webpack') const WebpackBar = require('webpackbar') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') module.exports = { mode: 'production', module: { rules: [ { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', ] }, { test: /\.jsx?$/, use: { loader: 'babel-loader' }, exclude: /(node_modules|dist|build-utils|webpack.config.js)/ } ] }, optimization: { minimizer: [ new UglifyJsPlugin({ cache: true, parallel: true, sourceMap: true }), new OptimizeCSSAssetsPlugin({}) ] }, plugins: [ new MiniCssExtractPlugin({ filename: '[name].css', chunkFilename: '[id].css' }), new webpack.EnvironmentPlugin({ NODE_ENV: 'production', DEBUG: false }), new UglifyJsPlugin({ sourceMap: true, uglifyOptions: { compress: { inline: false } } }), new WebpackBar({ profile: true, name: "Electrojet", }) ] }