PIU_proiect/webpack.config.js

51 lines
920 B
JavaScript
Raw Normal View History

2021-01-05 15:03:18 +00:00
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'
},
2021-01-05 17:25:31 +00:00
resolve: {
extensions: ['.js']
},
2021-01-05 15:03:18 +00:00
module: {
rules: [
{
test: /\.scss$/,
2021-01-05 17:25:31 +00:00
use: [
'style-loader',
{ loader: 'css-loader', options: { url: false } },
'sass-loader'
]
2021-01-05 15:03:18 +00:00
},
{
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
}
};