soiz1 commited on
Commit
2c2302b
·
verified ·
1 Parent(s): 763d20c

Update webpack.config.js

Browse files
Files changed (1) hide show
  1. webpack.config.js +70 -74
webpack.config.js CHANGED
@@ -166,7 +166,7 @@ if (!process.env.CI) {
166
  base.plugins.push(new RunStaticUploadPlugin());
167
 
168
  module.exports = [
169
- // 以下は元の設定のまま
170
  defaultsDeep({}, base, {
171
  entry: {
172
  'editor': './src/playground/editor.jsx',
@@ -209,7 +209,6 @@ module.exports = [
209
  'process.env.ROOT': JSON.stringify(root),
210
  'process.env.ROUTING_STYLE': JSON.stringify(process.env.ROUTING_STYLE || 'filehash')
211
  }),
212
- // 以下 HtmlWebpackPlugin, CopyWebpackPlugin 等は省略(元のまま)
213
  new HtmlWebpackPlugin({
214
  chunks: ['editor'],
215
  template: 'src/playground/index.ejs',
@@ -217,7 +216,75 @@ module.exports = [
217
  title: 'PenguinMod - Editor',
218
  ...htmlWebpackPluginCommon
219
  }),
220
- // ...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  new TWGenerateServiceWorkerPlugin()
222
  ])
223
  })
@@ -229,77 +296,6 @@ module.exports = [
229
  entry: {
230
  'scratch-gui': './src/index.js'
231
  },
232
- plugins: [
233
- new HtmlWebpackPlugin({
234
- chunks: ['playground'],
235
- template: 'src/playground/index.ejs',
236
- filename: 'playground.html',
237
- title: 'PenguinMod - Playground',
238
- ...htmlWebpackPluginCommon
239
- }),
240
- new HtmlWebpackPlugin({
241
- chunks: ['player'],
242
- template: 'src/playground/index.ejs',
243
- filename: 'index.html',
244
- title: 'PenguinMod - A mod of TurboWarp',
245
- ...htmlWebpackPluginCommon
246
- }),
247
- new HtmlWebpackPlugin({
248
- chunks: ['fullscreen'],
249
- template: 'src/playground/index.ejs',
250
- filename: 'fullscreen.html',
251
- title: 'PenguinMod - A mod of TurboWarp',
252
- ...htmlWebpackPluginCommon
253
- }),
254
- new HtmlWebpackPlugin({
255
- chunks: ['embed'],
256
- template: 'src/playground/index.ejs',
257
- filename: 'embed.html',
258
- title: 'Embedded Project - PenguinMod',
259
- noTheme: true,
260
- ...htmlWebpackPluginCommon
261
- }),
262
- new HtmlWebpackPlugin({
263
- chunks: ['addon-settings'],
264
- template: 'src/playground/simple.ejs',
265
- filename: 'addons.html',
266
- title: 'Addon Settings - PenguinMod',
267
- ...htmlWebpackPluginCommon
268
- }),
269
- new HtmlWebpackPlugin({
270
- chunks: ['credits'],
271
- template: 'src/playground/simple.ejs',
272
- filename: 'credits.html',
273
- title: 'PenguinMod & TurboWarp Credits',
274
- noSplash: true,
275
- ...htmlWebpackPluginCommon
276
- }),
277
- new CopyWebpackPlugin({
278
- patterns: [
279
- {
280
- from: 'static',
281
- to: ''
282
- }
283
- ]
284
- }),
285
- new CopyWebpackPlugin({
286
- patterns: [
287
- {
288
- from: 'node_modules/scratch-blocks/media',
289
- to: 'static/blocks-media'
290
- }
291
- ]
292
- }),
293
- new CopyWebpackPlugin({
294
- patterns: [
295
- {
296
- from: 'extensions/**',
297
- to: 'static',
298
- context: 'src/examples'
299
- }
300
- ]
301
- }),
302
- ],
303
  output: {
304
  libraryTarget: 'umd',
305
  filename: 'js/[name].js',
 
166
  base.plugins.push(new RunStaticUploadPlugin());
167
 
168
  module.exports = [
169
+ // to run editor examples
170
  defaultsDeep({}, base, {
171
  entry: {
172
  'editor': './src/playground/editor.jsx',
 
209
  'process.env.ROOT': JSON.stringify(root),
210
  'process.env.ROUTING_STYLE': JSON.stringify(process.env.ROUTING_STYLE || 'filehash')
211
  }),
 
212
  new HtmlWebpackPlugin({
213
  chunks: ['editor'],
214
  template: 'src/playground/index.ejs',
 
216
  title: 'PenguinMod - Editor',
217
  ...htmlWebpackPluginCommon
218
  }),
219
+ new HtmlWebpackPlugin({
220
+ chunks: ['playground'],
221
+ template: 'src/playground/index.ejs',
222
+ filename: 'playground.html',
223
+ title: 'PenguinMod - Playground',
224
+ ...htmlWebpackPluginCommon
225
+ }),
226
+ new HtmlWebpackPlugin({
227
+ chunks: ['player'],
228
+ template: 'src/playground/index.ejs',
229
+ filename: 'index.html',
230
+ title: 'PenguinMod - A mod of TurboWarp',
231
+ ...htmlWebpackPluginCommon
232
+ }),
233
+ new HtmlWebpackPlugin({
234
+ chunks: ['fullscreen'],
235
+ template: 'src/playground/index.ejs',
236
+ filename: 'fullscreen.html',
237
+ title: 'PenguinMod - A mod of TurboWarp',
238
+ ...htmlWebpackPluginCommon
239
+ }),
240
+ new HtmlWebpackPlugin({
241
+ chunks: ['embed'],
242
+ template: 'src/playground/index.ejs',
243
+ filename: 'embed.html',
244
+ title: 'Embedded Project - PenguinMod',
245
+ noTheme: true,
246
+ ...htmlWebpackPluginCommon
247
+ }),
248
+ new HtmlWebpackPlugin({
249
+ chunks: ['addon-settings'],
250
+ template: 'src/playground/simple.ejs',
251
+ filename: 'addons.html',
252
+ title: 'Addon Settings - PenguinMod',
253
+ ...htmlWebpackPluginCommon
254
+ }),
255
+ new HtmlWebpackPlugin({
256
+ chunks: ['credits'],
257
+ template: 'src/playground/simple.ejs',
258
+ filename: 'credits.html',
259
+ title: 'PenguinMod & TurboWarp Credits',
260
+ noSplash: true,
261
+ ...htmlWebpackPluginCommon
262
+ }),
263
+ new CopyWebpackPlugin({
264
+ patterns: [
265
+ {
266
+ from: 'static',
267
+ to: ''
268
+ }
269
+ ]
270
+ }),
271
+ new CopyWebpackPlugin({
272
+ patterns: [
273
+ {
274
+ from: 'node_modules/scratch-blocks/media',
275
+ to: 'static/blocks-media'
276
+ }
277
+ ]
278
+ }),
279
+ new CopyWebpackPlugin({
280
+ patterns: [
281
+ {
282
+ from: 'extensions/**',
283
+ to: 'static',
284
+ context: 'src/examples'
285
+ }
286
+ ]
287
+ }),
288
  new TWGenerateServiceWorkerPlugin()
289
  ])
290
  })
 
296
  entry: {
297
  'scratch-gui': './src/index.js'
298
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  output: {
300
  libraryTarget: 'umd',
301
  filename: 'js/[name].js',