51 lines
920 B
JavaScript
51 lines
920 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'
|
|
},
|
|
resolve: {
|
|
extensions: ['.js']
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.scss$/,
|
|
use: [
|
|
'style-loader',
|
|
{ loader: 'css-loader', options: { url: false } },
|
|
'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
|
|
}
|
|
};
|