File tree Expand file tree Collapse file tree 2 files changed +81
-2
lines changed Expand file tree Collapse file tree 2 files changed +81
-2
lines changed Original file line number Diff line number Diff line change 3535 "bootstrap-fileinput" : " ^4.4.9" ,
3636 "classnames" : " ^2.2.6" ,
3737 "cross-env" : " ^5.2.0" ,
38+ "css-loader" : " ^1.0.0" ,
39+ "file-loader" : " ^1.1.11" ,
3840 "jquery" : " ^3.3.1" ,
3941 "locks" : " ^0.2.2" ,
42+ "mini-css-extract-plugin" : " ^0.4.1" ,
4043 "node-sass" : " ^4.9.3" ,
4144 "prop-types" : " latest" ,
4245 "react" : " ^16.4.2" ,
4346 "react-dom" : " ^16.4.2" ,
4447 "react-native-listener" : " ^1.0.2" ,
4548 "react-router" : " ^4.3.1" ,
4649 "react-router-dom" : " ^4.3.1" ,
50+ "sass-loader" : " ^7.1.0" ,
4751 "semver" : " ^5.5.0" ,
4852 "sweetalert2" : " ^7.26.11" ,
4953 "sweetalert2-react-content" : " ^1.0.1" ,
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
2+ const MiniCssExtractPlugin = require ( "mini-css-extract-plugin" ) ;
23
34module . exports = {
4- entry : './ui/index.js' ,
5+ entry : {
6+ // js: './ui/index.js',
7+ sass : './ui/index.scss'
8+ } ,
59 output : {
610 filename : 'bundle.js' ,
711 path : path . resolve ( __dirname , 'app' )
@@ -20,10 +24,81 @@ module.exports = {
2024 use : {
2125 loader : 'babel-loader'
2226 }
27+ } ,
28+ {
29+ test : / \. s c s s $ / ,
30+ use : [
31+ MiniCssExtractPlugin . loader ,
32+ "css-loader" ,
33+ "sass-loader"
34+ ]
35+ } ,
36+ {
37+ test : / ( \. ( p n g | j p e ? g | g i f ) $ | ^ ( (? ! f o n t ) .) * \. s v g $ ) / ,
38+ loaders : [
39+ {
40+ loader : "file-loader" ,
41+ options : {
42+ name : path => {
43+ console . log ( "es ist ein BILD!" ) ;
44+ console . log ( path ) ;
45+ if ( ! / n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s / . test ( path ) ) {
46+ return "app/images/[name].[ext]?[hash]" ;
47+ }
48+
49+ return (
50+ "app/images/vendor/" +
51+ path . replace ( / \\ / g, "/" )
52+ . replace (
53+ / ( ( .* ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) ) | i m a g e s | i m a g e | i m g | a s s e t s ) \/ / g,
54+ ''
55+ ) +
56+ '?[hash]'
57+ ) ;
58+ } ,
59+ publicPath : 'app/'
60+ }
61+ }
62+ ]
63+ } ,
64+ {
65+ test : / ( \. ( w o f f 2 ? | t t f | e o t | o t f ) $ | f o n t .* \. s v g $ ) / ,
66+ loaders : [
67+ {
68+ loader : "file-loader" ,
69+ options : {
70+ name : path => {
71+ console . log ( "testausgabe" ) ;
72+ console . log ( path ) ;
73+ if ( ! / n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s / . test ( path ) ) {
74+ return 'app/fonts/[name].[ext]?[hash]' ;
75+ }
76+
77+ return (
78+ 'app/fonts' +
79+ '/vendor/' +
80+ path
81+ . replace ( / \\ / g, '/' )
82+ . replace (
83+ / ( ( .* ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) ) | f o n t s | f o n t | a s s e t s ) \/ / g,
84+ ''
85+ ) +
86+ '?[hash]'
87+ ) ;
88+ } ,
89+ publicPath : 'app/'
90+ }
91+ }
92+ ]
2393 }
2494 ]
2595 } ,
2696 performance : {
2797 hints : false
28- }
98+ } ,
99+ plugins : [
100+ new MiniCssExtractPlugin ( {
101+ filename : "bundle.css"
102+ } )
103+ ]
29104}
You can’t perform that action at this time.
0 commit comments