@@ -9,7 +9,6 @@ const glob = require('glob');
99const path = require ( 'path' ) ;
1010const SpriteLoaderPlugin = require ( 'svg-sprite-loader/plugin' ) ;
1111const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
12- const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
1312const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' ) ;
1413const options = require ( './<%= h.changeCase.lower(name) %>-options' ) ;
1514
@@ -25,21 +24,28 @@ const mapJSFilenamesToEntries = (pattern, globOptions) =>
2524 } ;
2625 } , { } ) ;
2726
27+ const entries = {
28+ 'entries/sprite' : glob . sync ( path . resolve ( __dirname , 'images/svg/**/*.svg' ) ) ,
29+ 'entries/drupalStyles' : glob . sync (
30+ options . cssFiles . drupalComponents ,
31+ options . cssFiles . drupalIgnore ,
32+ ) ,
33+ ...mapJSFilenamesToEntries ( options . jsFiles . drupalComponents , { } ) ,
34+ ...mapJSFilenamesToEntries ( options . jsFiles . storybookComponents , {
35+ ignore : options . jsFiles . storybookIgnore ,
36+ } ) ,
37+ } ;
38+
39+ const storybookStyles = glob . sync ( options . cssFiles . storybookComponents , {
40+ ignore : options . cssFiles . storybookIgnore ,
41+ } ) ;
42+
43+ if ( storybookStyles . length ) {
44+ entries [ 'entries/storybookStyles' ] = storybookStyles ;
45+ }
46+
2847module . exports = {
29- entry : {
30- 'entries/sprite' : glob . sync ( path . resolve ( __dirname , 'images/svg/**/*.svg' ) ) ,
31- 'entries/drupalStyles' : glob . sync (
32- options . cssFiles . drupalComponents ,
33- options . cssFiles . drupalIgnore ,
34- ) ,
35- 'entries/storybookStyles' : glob . sync ( options . cssFiles . storybookComponents , {
36- ignore : options . cssFiles . storybookIgnore ,
37- } ) ,
38- ...mapJSFilenamesToEntries ( options . jsFiles . drupalComponents , { } ) ,
39- ...mapJSFilenamesToEntries ( options . jsFiles . storybookComponents , {
40- ignore : options . jsFiles . storybookIgnore ,
41- } ) ,
42- } ,
48+ entry : entries ,
4349 output : {
4450 path : options . rootPath . dist ,
4551 filename : '[name].js' ,
0 commit comments