@@ -25,7 +25,6 @@ const baseConfig = new ScratchWebpackConfigBuilder(
25
25
{
26
26
rootPath : path . resolve ( __dirname ) ,
27
27
enableReact : true ,
28
- enableTs : true ,
29
28
shouldSplitChunks : false
30
29
} )
31
30
. setTarget ( 'browserslist' )
@@ -35,10 +34,7 @@ const baseConfig = new ScratchWebpackConfigBuilder(
35
34
library : {
36
35
name : 'GUI' ,
37
36
type : 'umd2'
38
- } ,
39
- // Do not clean the JS files before building as we have two outputs to the same
40
- // dist directory (the regular and the standalone version)
41
- clean : false
37
+ }
42
38
} ,
43
39
resolve : {
44
40
fallback : {
@@ -61,11 +57,11 @@ const baseConfig = new ScratchWebpackConfigBuilder(
61
57
. addPlugin ( new CopyWebpackPlugin ( {
62
58
patterns : [
63
59
{
64
- from : '../../ node_modules/scratch-blocks/media' ,
60
+ from : 'node_modules/scratch-blocks/media' ,
65
61
to : 'static/blocks-media/default'
66
62
} ,
67
63
{
68
- from : '../../ node_modules/scratch-blocks/media' ,
64
+ from : 'node_modules/scratch-blocks/media' ,
69
65
to : 'static/blocks-media/high-contrast'
70
66
} ,
71
67
{
@@ -76,7 +72,7 @@ const baseConfig = new ScratchWebpackConfigBuilder(
76
72
force : true
77
73
} ,
78
74
{
79
- context : '../../ node_modules/@scratch /scratch-vm/dist/web' ,
75
+ context : 'node_modules/scratch-vm/dist/web' ,
80
76
from : 'extension-worker.{js,js.map}' ,
81
77
noErrorOnMissing : true
82
78
}
@@ -91,13 +87,12 @@ if (!process.env.CI) {
91
87
const distConfig = baseConfig . clone ( )
92
88
. merge ( {
93
89
entry : {
94
- 'scratch-gui' : path . join ( __dirname , 'src/index.ts ' )
90
+ 'scratch-gui' : path . join ( __dirname , 'src/index.js ' )
95
91
} ,
96
92
output : {
97
93
path : path . resolve ( __dirname , 'dist' )
98
94
}
99
95
} )
100
- . addExternals ( [ 'react' , 'react-dom' , 'redux' , 'react-redux' ] )
101
96
. addPlugin (
102
97
new CopyWebpackPlugin ( {
103
98
patterns : [
@@ -110,17 +105,6 @@ const distConfig = baseConfig.clone()
110
105
} )
111
106
) ;
112
107
113
- // build the shipping library in `dist/` bundled with react, react-dom, redux, etc.
114
- const distStandaloneConfig = baseConfig . clone ( )
115
- . merge ( {
116
- entry : {
117
- 'scratch-gui-standalone' : path . join ( __dirname , 'src/index-standalone.tsx' )
118
- } ,
119
- output : {
120
- path : path . resolve ( __dirname , 'dist' )
121
- }
122
- } ) ;
123
-
124
108
// build the examples and debugging tools in `build/`
125
109
const buildConfig = baseConfig . clone ( )
126
110
. enableDevServer ( process . env . PORT || 8601 )
@@ -132,13 +116,7 @@ const buildConfig = baseConfig.clone()
132
116
player : './src/playground/player.jsx'
133
117
} ,
134
118
output : {
135
- path : path . resolve ( __dirname , 'build' ) ,
136
-
137
- // This output is loaded using a file:// scheme from the local file system.
138
- // Having `publicPath: '/'` (the default) means the `gui.js` file in `build/index.html`
139
- // would be looked for at the root of the filesystem, which is incorrect.
140
- // Hence, we're resetting the public path to be relative.
141
- publicPath : ''
119
+ path : path . resolve ( __dirname , 'build' )
142
120
}
143
121
} )
144
122
. addPlugin ( new HtmlWebpackPlugin ( {
@@ -189,5 +167,5 @@ const buildConfig = baseConfig.clone()
189
167
const buildDist = process . env . NODE_ENV === 'production' || process . env . BUILD_MODE === 'dist' ;
190
168
191
169
module . exports = buildDist ?
192
- [ buildConfig . get ( ) , distStandaloneConfig . get ( ) , distConfig . get ( ) ] :
170
+ [ buildConfig . get ( ) , distConfig . get ( ) ] :
193
171
buildConfig . get ( ) ;
0 commit comments