1
- const HtmlWebPackPlugin = require ( 'html-webpack-plugin' )
2
- const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' )
1
+ const HtmlWebPackPlugin = require ( 'html-webpack-plugin' ) ;
2
+ const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' ) ;
3
+ const webpack = require ( 'webpack' ) ;
3
4
var path = require ( "path" ) ;
4
5
const options = { } ;
5
6
@@ -12,7 +13,7 @@ module.exports = {
12
13
"interactivetests" : "./samples/javascript.controls/common/tests.js" ,
13
14
} ,
14
15
devServer : {
15
- contentBase : './' ,
16
+ static : './' ,
16
17
hot : true ,
17
18
port : 8080
18
19
} ,
@@ -54,17 +55,25 @@ module.exports = {
54
55
] ,
55
56
} ,
56
57
resolve : {
57
- extensions : [ '.js' , '.scss' ]
58
+ extensions : [ '.js' , '.scss' ] ,
59
+ fallback : {
60
+ stream : require . resolve ( 'stream-browserify' ) ,
61
+ util : require . resolve ( 'util/' )
62
+ }
58
63
} ,
59
64
plugins : [
60
- new CleanWebpackPlugin ( ) ,
61
- // new HtmlWebPackPlugin({
62
- // template: './*.html',
63
- // filename: './*.html'
64
- // }),
65
- // new HtmlWebPackPlugin({
66
- // template: './photos.html',
67
- // filename: './photos.html'
68
- // })
65
+ new CleanWebpackPlugin ( ) ,
66
+ // fix "process is not defined" error:
67
+ new webpack . ProvidePlugin ( {
68
+ process : 'process/browser' ,
69
+ } ) ,
70
+ // new HtmlWebPackPlugin({
71
+ // template: './*.html',
72
+ // filename: './*.html'
73
+ // }),
74
+ // new HtmlWebPackPlugin({
75
+ // template: './photos.html',
76
+ // filename: './photos.html'
77
+ // })
69
78
]
70
79
} ;
0 commit comments