11const path = require ( "path" ) ;
2- const webpack = require ( "webpack" ) ;
32
43module . exports = {
5- context : path . resolve ( __dirname ) ,
6-
7- entry : "./index.js" ,
8-
4+ entry : "./demo/index.js" ,
95 resolve : {
106 extensions : [ ".js" ] ,
117 modules : [ path . resolve ( "./" ) , "node_modules" ] ,
8+ fallback : {
9+ fs : false ,
10+ path : require . resolve ( "path-browserify" ) ,
11+ } ,
1212 } ,
1313 output : {
1414 filename : "bundle.js" ,
15- // the output bundle
16-
17- path : path . resolve ( __dirname , "./" /*"./dist"*/ ) ,
15+ path : path . resolve ( __dirname , "./" ) ,
1816 } ,
19-
17+ mode : "development" ,
2018 module : {
2119 rules : [
2220 {
@@ -29,49 +27,21 @@ module.exports = {
2927 use : [ "style-loader" , "css-loader" ] ,
3028 } ,
3129 {
32- test : / \. s c s s $ / ,
33- use : [
34- {
35- loader : "style-loader" ,
36- options : { sourceMap : true } , // creates style nodes from JS strings
37- } ,
38- {
39- loader : "css-loader" ,
40- options : { sourceMap : true } , // translates CSS into CommonJS
41- } ,
42- {
43- loader : "sass-loader" ,
44- options : { sourceMap : true } , // compiles Sass to CSS
45- } ,
46- ] ,
30+ test : / \. s v g $ / ,
31+ loader : "svg-inline-loader" ,
32+ } ,
33+ {
34+ test : / \. h t m l $ / i,
35+ loader : "html-loader" ,
4736 } ,
4837 ] ,
4938 } ,
50-
51- plugins : [
52- new webpack . ProvidePlugin ( {
53- Promise : "es6-promise" ,
54- fetch :
55- "imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch" ,
56- } ) ,
57-
58- new webpack . HotModuleReplacementPlugin ( ) ,
59- // enable HMR globally
60-
61- new webpack . NoEmitOnErrorsPlugin ( ) ,
62- // do not emit compiled assets that include errors
63- ] ,
64-
6539 devServer : {
66- // watchContentBase: true, // initiate a page refresh if static content changes
40+ watchContentBase : true ,
6741 host : "0.0.0.0" ,
6842 port : 8080 ,
6943 historyApiFallback : false ,
70- hot : true ,
44+ hot : false ,
7145 contentBase : "./demo" ,
72- open : true ,
7346 } ,
74- node : {
75- fs : "empty" ,
76- }
7747} ;
0 commit comments