UNPKG

1.35 kBJavaScriptView Raw
1
2//
3// WebPack config file
4
5const webpack = require('webpack')
6const path = require('path')
7
8module.exports = {
9 plugins: [],
10 module: {
11 rules: []
12 }
13}
14// The app's starting file
15module.exports.entry = ['@babel/polyfill', path.join(__dirname, 'index-browser.js')]
16
17// The final app's JS output file
18module.exports.output = {
19 path: path.join(__dirname, '../dist/'),
20 filename: 'blockv-faces.min.js',
21 // libraryTarget: 'var',
22 // libraryExport: ['Blockv', 'VatomView', 'FaceSelection', 'BaseFace'],
23 // library: 'Blockv'
24}
25// Output a sourcemap
26module.exports.devtool = 'source-map'
27
28// Compile support for ES6 classes and React etc
29module.exports.module.rules.push({
30 test: /\.js$/,
31 exclude: /node_modules/,
32 loader: 'babel-loader',
33 options: {
34 presets: ['@babel/preset-env']
35 }
36})
37
38// Compile support for CSS
39module.exports.module.rules.push({
40 test: /\.css$/,
41 loaders: ['style', 'css']
42})
43module.exports.module.rules.push({
44 test: /(\.scss|\.css)$/,
45 loader: 'style!css!postcss!sass'
46})
47
48module.exports.module.rules.push({
49 test: /(\.png|\.svg|\.jpg)$/,
50 loader: 'url-loader'
51})
52module.exports.node = {
53 console: true,
54 fs: 'empty',
55 net: 'empty',
56 tls: 'empty'
57}
58
59module.exports.plugins.push(new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }))