This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
83 lines (77 loc) · 2.04 KB
/
webpack.prod.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
72
73
74
75
76
77
78
79
80
81
82
83
// NOTE: This is a placeholder file for the production environemnt.
// It may require additional changes.
const path = require('path');
const { merge } = require('webpack-merge');
const TerraDevSite = require('./packages/terra-dev-site/src/webpack/plugin/TerraDevSite');
const WebpackConfigTerra = require('./packages/webpack-config-terra/lib/webpack.config');
const coreConfig = () => ({
entry: {
index: path.join(__dirname, 'index'),
},
resolve: {
fallback: {
fs: false,
path: require.resolve('path'),
},
extensions: ['.jst'],
},
plugins: [
new TerraDevSite({
titleConfig: {
title: 'Terra',
},
primaryNavigationItems: [{
path: '/home',
label: 'Home',
contentExtension: 'home',
additionalContent: [
{
label: 'Home',
filePath: path.resolve(process.cwd(), 'README.md'),
},
],
},
// {
// path: '/about',
// label: 'About',
// contentExtension: 'about',
// },
{
path: '/application',
label: 'Application',
contentExtension: 'app',
},
// {
// path: '/components',
// label: 'Components',
// contentExtension: 'doc',
// }, {
// path: '/graphs',
// label: 'Graphs',
// contentExtension: 'graph',
// },
{
path: '/dev_tools',
label: 'Developer Tools',
contentExtension: 'tool',
}, {
path: '/guides',
label: 'Guides',
contentExtension: 'guide',
}],
// sideEffectImportFilePaths: [
// '../../../../terra-ui-repo/src/initializeXFC.js',
// '../../../../terra-ui-repo/src/IllustrationGrid.scss',
// ],
}),
],
});
const mergedConfig = (env, argv) => (
merge(WebpackConfigTerra(env, argv), coreConfig())
);
module.exports = (env, argv) => {
const config = mergedConfig(env, argv);
// Brittle
config.module.rules[0].oneOf[0].test = /\.(jsx|js|jst)$/;
return config;
};