11const SpeedMeasurePlugin = require ( 'speed-measure-webpack-plugin' ) ;
22const DuplicatePackageCheckerPlugin = require ( 'duplicate-package-checker-webpack-plugin' ) ;
3- const smp = new SpeedMeasurePlugin ( ) ;
43const webpack = require ( 'webpack' ) ;
54const pkg = require ( './package' ) ;
65const path = require ( 'path' ) ;
76
87const banner = `${ pkg . name } ${ pkg . version } - ${ pkg . description } \nCopyright (c) ${ new Date ( ) . getFullYear ( ) } ${ pkg . author } - ${ pkg . homepage } \nLicense: ${ pkg . license } ` ;
98
109const webpackConfig = {
11- ' context' : path . resolve ( __dirname , 'src' ) ,
12- ' entry' : './index.js' ,
13- ' output' : {
14- ' path' : __dirname ,
15- ' filename' : ` ${ pkg . name } .min.js` ,
16- ' library' : 'MarkerAnimation' ,
17- ' libraryTarget' : 'umd' ,
10+ context : path . resolve ( __dirname , 'src' ) ,
11+ entry : './index.js' ,
12+ output : {
13+ path : path . resolve ( __dirname , 'build' ) ,
14+ filename : 'index.js' ,
15+ library : 'MarkerAnimation' ,
16+ libraryTarget : 'umd' ,
1817 } ,
19- ' module' : {
20- ' rules' : [
18+ module : {
19+ rules : [
2120 {
22- ' test' : / \. j s $ / ,
23- ' exclude' : / n o d e _ m o d u l e s / ,
24- ' loader' : 'babel-loader' ,
21+ test : / \. j s $ / ,
22+ exclude : / n o d e _ m o d u l e s / ,
23+ loader : 'babel-loader' ,
2524 } ,
2625 ] ,
2726 } ,
@@ -33,10 +32,10 @@ const webpackConfig = {
3332 amd : 'jquery' ,
3433 } ,
3534 } ,
36- ' plugins' : [
35+ plugins : [
3736 new webpack . BannerPlugin ( banner ) ,
3837 new DuplicatePackageCheckerPlugin ( ) ,
3938 ] ,
4039} ;
4140
42- module . exports = smp . wrap ( webpackConfig ) ;
41+ module . exports = ( new SpeedMeasurePlugin ( ) ) . wrap ( webpackConfig ) ;
0 commit comments