File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 4444< body >
4545 < div id ="swagger-editor "> </ div >
4646
47- <!-- ./dist/* is just the dist folder.. assets on the root have HMR injected -- >
48- < script src =". /swagger-editor-bundle.js "> </ script >
49- < script src =". /swagger-editor-standalone-preset.js "> </ script >
47+ < script src =" /commons.js " > </ script >
48+ < script src ="/swagger-editor-bundle.js "> </ script >
49+ < script src ="/swagger-editor-standalone-preset.js "> </ script >
5050 < script >
5151 window . onload = function ( ) {
5252 // Webpack outputs library variables with file-names-like-this
Original file line number Diff line number Diff line change @@ -161,9 +161,9 @@ module.exports = function(options) {
161161
162162 devtool : specialOptions . sourcemaps ? 'cheap-module-source-map' : null ,
163163
164- plugins,
165-
166164 } , options )
167165
166+ completeConfig . plugins = ( plugins ) . concat ( options . plugins || [ ] )
167+
168168 return completeConfig
169169}
Original file line number Diff line number Diff line change 11var path = require ( "path" )
2+ var webpack = require ( 'webpack' )
3+
24
35module . exports = require ( "./make-webpack-config.js" ) ( {
46 _special : {
@@ -10,13 +12,19 @@ module.exports = require("./make-webpack-config.js")({
1012 }
1113 } ,
1214
15+ plugins : [
16+ new webpack . optimize . CommonsChunkPlugin ( { name : 'commons' } ) ,
17+ ] ,
18+
1319 entry : {
1420 "swagger-editor-bundle" : [
1521 './src/index.js'
1622 ] ,
1723 'swagger-editor-standalone-preset' : [
1824 './src/standalone/index.js'
19- ]
25+ ] ,
26+ 'commons' : [ 'react' ]
27+
2028 } ,
2129
2230 output : {
@@ -32,6 +40,7 @@ module.exports = require("./make-webpack-config.js")({
3240 devServer : {
3341 port : 3200 ,
3442 path : path . join ( __dirname , "dev-helpers" ) ,
43+ contentBase : path . join ( __dirname , "dev-helpers" ) ,
3544 publicPath : "/" ,
3645 noInfo : true ,
3746 colors : true ,
You can’t perform that action at this time.
0 commit comments