Skip to content

Commit 87f420b

Browse files
committed
Initial commit
0 parents  commit 87f420b

File tree

12 files changed

+13766
-0
lines changed

12 files changed

+13766
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
.cache
5+
6+
# Editor directories and files
7+
.idea
8+
.vscode
9+
*.suo
10+
*.ntvs*
11+
*.njsproj
12+
*.sln
13+
*.sw?

bundler/webpack.common.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
const CopyWebpackPlugin = require('copy-webpack-plugin')
2+
const HtmlWebpackPlugin = require('html-webpack-plugin')
3+
const path = require('path')
4+
5+
module.exports = {
6+
entry: path.resolve(__dirname, '../src/index.js'),
7+
output:
8+
{
9+
filename: 'bundle.[hash].js',
10+
path: path.resolve(__dirname, '../dist')
11+
},
12+
devtool: 'source-map',
13+
plugins:
14+
[
15+
new CopyWebpackPlugin([ { from: path.resolve(__dirname, '../static') } ]),
16+
new HtmlWebpackPlugin({
17+
template: path.resolve(__dirname, '../src/index.html'),
18+
minify: true
19+
})
20+
],
21+
module:
22+
{
23+
rules:
24+
[
25+
// HTML
26+
{
27+
test: /\.(html)$/,
28+
use: ['html-loader']
29+
},
30+
31+
// JS
32+
{
33+
test: /\.js$/,
34+
exclude: /node_modules/,
35+
use:
36+
[
37+
'babel-loader'
38+
]
39+
},
40+
41+
// CSS
42+
{
43+
test: /\.css$/,
44+
use:
45+
[
46+
'style-loader',
47+
'css-loader'
48+
]
49+
},
50+
51+
// Images
52+
{
53+
test: /\.(jpg|png|gif|svg)$/,
54+
use:
55+
[
56+
{
57+
loader: 'file-loader',
58+
options:
59+
{
60+
outputPath: 'assets/images/'
61+
}
62+
}
63+
]
64+
},
65+
66+
// Shaders
67+
{
68+
test: /\.(glsl|vs|fs|vert|frag)$/,
69+
exclude: /node_modules/,
70+
use: [
71+
'raw-loader',
72+
'glslify-loader'
73+
]
74+
}
75+
]
76+
}
77+
}

bundler/webpack.dev.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const webpackMerge = require('webpack-merge')
2+
const commonConfiguration = require('./webpack.common.js')
3+
4+
module.exports = webpackMerge(
5+
commonConfiguration,
6+
{
7+
mode: 'development',
8+
devServer:
9+
{
10+
host: '0.0.0.0',
11+
contentBase: './dist',
12+
open: true,
13+
https: false,
14+
useLocalIp: true
15+
}
16+
}
17+
)

bundler/webpack.prod.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const webpackMerge = require('webpack-merge')
2+
const commonConfiguration = require('./webpack.common.js')
3+
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
4+
5+
module.exports = webpackMerge(
6+
commonConfiguration,
7+
{
8+
mode: 'production',
9+
plugins:
10+
[
11+
new CleanWebpackPlugin()
12+
]
13+
}
14+
)

0 commit comments

Comments
 (0)