Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
81 lines (80 loc) · 1.97 KB
/
Copy pathwebpack.config.js
File metadata and controls
81 lines (80 loc) · 1.97 KB
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
var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var loadCSS = new ExtractTextPlugin('build/app.css')
module.exports = {
entry: './js',
output: {
path: path.resolve(__dirname, './build'),
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
},
{
test: /\.css$/,
loader: loadCSS.extract('style', 'css'),
exclude: /node_modules/
},
{
test: /\.json?$/,
loader: 'json',
exclude: /node_modules/
},
{
test: /\.gif$|\.jpe?g$|\.woff|\.eot|\.ttf|\.png$|\.svg$/i,
loader: 'url?limit=10000&name=[name].[ext]',
exclude: /node_modules/
}
]
},
plugins: [
new HtmlWebpackPlugin({
title: 'webVR_404',
template: path.resolve(__dirname, './index.ejs')
}),
loadCSS,
// {output}/file.txt
new CopyWebpackPlugin([
{
from: './node_modules/es6-promise/dist/es6-promise.min.js',
to: 'es6-promise.min.js'
},
{
from: './node_modules/three/build/three.min.js',
to: 'three.min.js'
},
{
from: './node_modules/three/examples/js/controls/VRControls.js',
to: 'VRControls.js'
},
{
from: './node_modules/three/examples/js/effects/VREffect.js',
to: 'VREffect.js'
},
{
from: './node_modules/webvr-polyfill/build/webvr-polyfill.min.js',
to: 'webvr-polyfill.min.js'
},
{
from: './node_modules/webvr-ui/build/webvr-ui.min.js',
to: 'webvr-ui.min.js'
},
{
from: './img',
to: './img'
},
])
],
devtool: "#inline-source-map",
devServer: {
contentBase: path.resolve(__dirname, './build'),
host: "0.0.0.0"
}
};