This repository was archived by the owner on Jun 3, 2024. It is now read-only.
File tree 4 files changed +26
-9
lines changed
dash_core_components_base
4 files changed +26
-9
lines changed Original file line number Diff line number Diff line change
1
+ include dash_core_components/dash_core_components.css
1
2
include dash_core_components/dash_core_components.min.js
2
3
include dash_core_components/dash_core_components.min.js.map
3
4
include dash_core_components/dash_core_components-shared.js
Original file line number Diff line number Diff line change 135
135
},
136
136
])
137
137
138
+ _css_dist = [
139
+ {
140
+ 'relative_package_path' : '{}.css' .format (__name__ ),
141
+ 'namespace' : 'dash_core_components' ,
142
+ }
143
+ ]
144
+
138
145
for _component in __all__ :
139
- setattr (locals ()[_component ], '_js_dist' , _js_dist )
146
+ setattr (locals ()[_component ], '_js_dist' , _js_dist )
147
+ setattr (locals ()[_component ], '_css_dist' , _css_dist )
Original file line number Diff line number Diff line change 78
78
"exec-sh" : " ^0.3.0" ,
79
79
"identity-obj-proxy" : " ^3.0.0" ,
80
80
"jest" : " ^24.5.0" ,
81
+ "mini-css-extract-plugin" : " ^0.9.0" ,
81
82
"npm-run-all" : " ^4.1.5" ,
83
+ "optimize-css-assets-webpack-plugin" : " ^5.0.3" ,
82
84
"prettier" : " ^1.14.2" ,
83
85
"react" : " ^16.8.6" ,
84
86
"react-dom" : " ^16.8.6" ,
85
87
"react-jsx-parser" : " ^1.21.0" ,
86
88
"react-resize-detector" : " ^4.2.1" ,
87
- "style-loader" : " ^0.23.1 " ,
89
+ "style-loader" : " ^1.0.0 " ,
88
90
"styled-jsx" : " ^3.1.1" ,
89
91
"terser-webpack-plugin" : " ^2.3.0" ,
90
92
"webpack" : " ^4.37.0" ,
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
2
const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
3
+ const MiniCssExtractPlugin = require ( "mini-css-extract-plugin" ) ;
4
+ const OptimizeCSSAssetsPlugin = require ( "optimize-css-assets-webpack-plugin" ) ;
3
5
const webpack = require ( 'webpack' ) ;
4
6
const WebpackDashDynamicImport = require ( '@plotly/webpack-dash-dynamic-import' ) ;
5
7
@@ -82,10 +84,10 @@ module.exports = (env, argv) => {
82
84
test : / \. c s s $ / ,
83
85
use : [
84
86
{
85
- loader : 'style-loader' ,
86
- options : {
87
- insertAt : 'top'
88
- }
87
+ loader :
88
+ mode === "production"
89
+ ? MiniCssExtractPlugin . loader
90
+ : "style-loader" ,
89
91
} ,
90
92
{
91
93
loader : 'css-loader' ,
@@ -109,7 +111,8 @@ module.exports = (env, argv) => {
109
111
warnings : false ,
110
112
ie8 : false
111
113
}
112
- } )
114
+ } ) ,
115
+ new OptimizeCSSAssetsPlugin ( { } )
113
116
] ,
114
117
splitChunks : {
115
118
name : true ,
@@ -131,11 +134,14 @@ module.exports = (env, argv) => {
131
134
}
132
135
} ,
133
136
plugins : [
134
- new WebpackDashDynamicImport ( ) ,
137
+ new MiniCssExtractPlugin ( {
138
+ filename : `${ dashLibraryName } .css` ,
139
+ } ) ,
140
+ //new WebpackDashDynamicImport(),
135
141
new webpack . SourceMapDevToolPlugin ( {
136
142
filename : '[file].map' ,
137
143
exclude : [ 'async~plotlyjs' ]
138
144
} )
139
145
]
140
146
}
141
- } ;
147
+ } ;
You can’t perform that action at this time.
0 commit comments