This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
71 lines (69 loc) · 1.94 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
62
63
64
65
66
67
68
69
70
71
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const DIST_DIR = path.resolve(__dirname, 'nf-virtru-plugin');
const SRC_DIR = path.resolve(__dirname, 'src');
module.exports = {
entry: {
'admin/assets/js/decrypt': `./src/admin/decrypt/index.js`,
'admin/assets/js/policyPage': `./src/admin/policyPage/index.js`,
'assets/js/bundle': `./src/frontend/index.js`,
},
output: {
path: DIST_DIR,
filename: '[name].js',
},
node: {
'fs': 'empty'
},
module: {
rules: [
{
test: /\.jsx?$/,
include: [
SRC_DIR,
],
loader: 'babel-loader',
options: {
configFile: path.join(__dirname, 'babel.config.js'),
},
},
{
test: /\.html$/,
use: {
loader: 'html-loader'
}
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
sourceMap: true,
importLoaders: 1,
modules: true,
},
},
{
loader: 'postcss-loader',
options: {
config: {
path: path.join(__dirname, '.'),
},
},
},
],
},
]
},
plugins: [
new CopyPlugin([
{ from: 'admin', to: 'admin' },
{ from: 'assets', to: 'assets' },
{ from: '*.php' },
]),
]
};