-
Notifications
You must be signed in to change notification settings - Fork 121
/
webpack.config.js
61 lines (60 loc) · 2.08 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
output: {
path: path.resolve(__dirname, "styles/css")
},
entry: {
index: [path.join(path.resolve(__dirname, 'styles'), "scss", "application.scss")]
},
mode: "production",
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
},
{
test: /\.(woff(2)?|ttf|eot|svg)$/,
type: 'asset/resource',
generator: {
filename: './fonts/[name][ext]'
}
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: "application.css"
}),
new CopyPlugin({
patterns: [
{
from: path.join(path.resolve(__dirname, 'node_modules'), 'h5p-image-cropper', 'cropper.js'),
to: path.join(path.resolve(__dirname, 'libs'), 'cropper.js')
},
{
from: path.join(path.resolve(__dirname, 'node_modules'), 'h5p-image-cropper', 'cropper.css'),
to: path.join(path.resolve(__dirname, 'libs'), 'cropper.css')
},
{
from: path.join(path.resolve(__dirname, 'node_modules'), 'h5p-image-cropper', 'images'),
to: path.join(path.resolve(__dirname, 'images'), 'cropper')
},
{
from: path.join(path.resolve(__dirname, 'node_modules'), 'zebra_datepicker', 'dist', 'zebra_datepicker.min.js'),
to: path.join(path.resolve(__dirname, 'libs'), 'zebra_datepicker.min.js')
},
{
from: path.join(path.resolve(__dirname, 'node_modules'), 'zebra_datepicker', 'dist', 'css', 'bootstrap', 'zebra_datepicker.min.css'),
to: path.join(path.resolve(__dirname, 'styles'), 'css', 'libs', 'zebra_datepicker.min.css')
},
{
from: path.join(path.resolve(__dirname, 'node_modules'), 'zebra_datepicker', 'dist', 'css', 'bootstrap', 'icons.png'),
to: path.join(path.resolve(__dirname, 'styles'), 'css', 'libs', 'icons.png')
}
]
})
]
};