-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
111 lines (106 loc) · 3.8 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
const path = require('path');
const ExtendedDefinePlugin = require('extended-define-webpack-plugin');
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
// var HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
// var StatsPlugin = require('stats-webpack-plugin');
module.exports = {
// cache: {
// type: 'filesystem',
// buildDependencies: {
// config: [ __filename, ],
// },
// },
context: path.join(__dirname, '/src/js'),
entry: {
auth: './auth.js',
errorPage: './errorPage.js',
editThreeStyleQuizList: './editThreeStyleQuizList.js',
importThreeStyle: './importThreeStyle.js',
index: './index.js',
letterPairTable: './letterPairTable.js',
letterPairQuiz: './letterPairQuiz.js',
listThreeStyle: './listThreeStyle.js',
m2Method: './m2Method.js',
mypage: './mypage.js',
numbering3: './numbering3.js',
oldPochmannMethod: './oldPochmannMethod.js',
orozcoMethod: './orozcoMethod.js',
registerFaceColor: './registerFaceColor.js',
registerLetterPair: './registerLetterPair.js',
registerThreeStyle: './registerThreeStyle.js',
signup: './signup.js',
signin: './signin.js',
signout: './signout.js',
threeStyleTable: './threeStyleTable.js',
threeStyleQuiz: './threeStyleQuiz.js',
threeStyleQuizStats: './threeStyleQuizStats.js',
threeStyleScrambler: './threeStyleScrambler.js',
transformFromAnalysis: './transformFromAnalysis.js',
tutorialAnalysisForBeginner: './tutorialAnalysisForBeginner.js',
},
output: {
path: path.join(__dirname, '/dist'),
filename: './[name].bundle.js',
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets: [ '@babel/preset-react', ],
plugins: [ '@babel/plugin-transform-runtime', ],
},
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
importLoaders: 1,
},
},
],
},
{
test: /\.(jpg|png)$/,
use: [
{
loader: 'url-loader',
},
],
},
],
noParse: [ path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.min.js'), ],
},
resolve: {
alias: {
'handsontable': path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.min.js'),
'handsontable.css': path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.min.css'),
},
fallback: {
fs: false,
},
},
plugins: [
new ExtendedDefinePlugin({
DEPLOY_ENV: process.env.DEPLOY_ENV ? JSON.stringify(process.env.DEPLOY_ENV) : 'stg',
}),
new MomentLocalesPlugin({
localesToKeep: [ 'ja', ],
}),
// 不安定なのでコメントアウトして使わないようにした
// new HardSourceWebpackPlugin(),
// バンドルの大きさを調べたい時だけアンコメントする。Macに入れてあるwebpack-bundle-analyzerと連携
// new StatsPlugin('stats.json', {
// chunkModules: true,
// }),
new NodePolyfillPlugin(),
],
};