PIU_proiect/webpack.config.js
2021-01-05 17:03:18 +02:00

44 lines
817 B
JavaScript

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
}
};