File tree Expand file tree Collapse file tree 2 files changed +48
-2
lines changed Expand file tree Collapse file tree 2 files changed +48
-2
lines changed Original file line number Diff line number Diff line change 7
7
"description" : " Media player and real-time audio spectrum analyzer" ,
8
8
"scripts" : {
9
9
"build" : " webpack" ,
10
- "start" : " http-server"
10
+ "start" : " http-server" ,
11
+ "dev" : " webpack serve --config webpack.dev.js"
11
12
},
12
13
"devDependencies" : {
13
14
"audiomotion-analyzer" : " ^4.5.1" ,
21
22
"notie" : " ^4.3.1" ,
22
23
"process" : " ^0.11.10" ,
23
24
"sortablejs" : " ^1.15.2" ,
25
+ "style-loader" : " ^4.0.0" ,
24
26
"webpack" : " ^5.91.0" ,
25
- "webpack-cli" : " ^5.1.4"
27
+ "webpack-cli" : " ^5.1.4" ,
28
+ "webpack-dev-server" : " ^5.2.2"
26
29
}
27
30
}
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' ) ;
2
+ const webpack = require ( 'webpack' ) ;
3
+
4
+ module . exports = {
5
+ mode : 'development' ,
6
+ entry : './src/index.js' ,
7
+ devtool : 'inline-source-map' ,
8
+ devServer : {
9
+ static : {
10
+ directory : path . join ( __dirname , 'public' ) ,
11
+ } ,
12
+ compress : true ,
13
+ port : 9000 ,
14
+ hot : true ,
15
+ open : true ,
16
+ } ,
17
+ module : {
18
+ rules : [
19
+ {
20
+ test : / \. c s s $ / ,
21
+ use : [
22
+ 'style-loader' , // Use style-loader instead of MiniCssExtractPlugin in dev
23
+ {
24
+ loader : 'css-loader' ,
25
+ options : { url : false } ,
26
+ } ,
27
+ ] ,
28
+ } ,
29
+ ] ,
30
+ } ,
31
+ plugins : [
32
+ new webpack . HotModuleReplacementPlugin ( ) ,
33
+ new webpack . ProvidePlugin ( {
34
+ Buffer : [ 'buffer' , 'Buffer' ] ,
35
+ process : 'process/browser.js' ,
36
+ } ) ,
37
+ ] ,
38
+ output : {
39
+ filename : 'audioMotion.js' ,
40
+ path : path . resolve ( __dirname , 'public' ) ,
41
+ clean : true ,
42
+ } ,
43
+ } ;
You can’t perform that action at this time.
0 commit comments