const path = require('path'); const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { mode: process.env.NODE_ENV || 'development', entry: './src/script/index.js', output: { path: path.resolve(__dirname, 'build'), filename: 'index.js', libraryTarget: 'var', library: 'ui' }, module: { rules: [ { test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] }, { test: /\.js$/, exclude: /node_modules/, use: ['babel-loader'] } ] }, plugins: [ new CopyWebpackPlugin({ patterns: [ { from: 'src', to: '.', globOptions: { ignore: ['**/script/**/*', '**/style/**/*'] } } ] }) ], devServer: { contentBase: path.join(__dirname, 'src'), open: true } };