-
Notifications
You must be signed in to change notification settings - Fork 134
/
webpack.config.js
43 lines (42 loc) · 1.18 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
const path = require('path');
module.exports = {
entry: {
head: './assets/js/head.js',
main: './assets/js/index.js',
collapse: './assets/js/collapse.js',
contact: './assets/js/contact.js',
content: './assets/js/content.js',
graph: './assets/js/graph.js',
hero: './assets/js/hero.js',
portfolio: './assets/js/portfolio.js',
pricing: './assets/js/pricing.js',
react: './assets/js/react.js',
search: './assets/js/search.js',
stripe: './assets/js/stripe.js',
'dev-jq-helpers': './assets/js/helpers/jq-helpers.js'
},
output: {
path: path.resolve('./'),
filename: (pathData) => {
return pathData.chunk.name.indexOf('dev') === 0 ? 'exampleSite/static/scripts/[name].js': 'assets/scripts/syna-[id].js';
},
},
resolve: {
extensions: ['.js', '.jsx'],
modules: [path.join(process.cwd(), 'src'), 'node_modules'],
},
mode: process.env === 'production' ? 'production' : 'development',
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/env', '@babel/react'],
},
},
}],
},
plugins: [],
};