@@ -31,14 +31,15 @@ const toPath = path => {
31
31
class ScratchWebpackConfigBuilder {
32
32
/**
33
33
* @param {object } options Options for the webpack configuration.
34
- * @param {string|URL } options.rootPath The absolute path to the project root.
34
+ * @param {string|URL } [ options.rootPath] The absolute path to the project root.
35
35
* @param {string|URL } [options.distPath] The absolute path to build output. Defaults to `dist` under `rootPath`.
36
+ * @param {string|URL } [options.publicPath] The public location where the output assets will be located. Defaults to `/`.
36
37
* @param {boolean } [options.enableReact] Whether to enable React and JSX support.
37
38
* @param {string } [options.libraryName] The name of the library to build. Shorthand for `output.library.name`.
38
39
* @param {string|URL } [options.srcPath] The absolute path to the source files. Defaults to `src` under `rootPath`.
39
40
* @param {boolean } [options.shouldSplitChunks] Whether to enable spliting code to chunks.
40
41
*/
41
- constructor ( { distPath, enableReact, enableTs, libraryName, rootPath, srcPath, shouldSplitChunks } ) {
42
+ constructor ( { distPath, enableReact, enableTs, libraryName, rootPath, srcPath, publicPath = '/' , shouldSplitChunks } ) {
42
43
const isProduction = process . env . NODE_ENV === 'production' ;
43
44
const mode = isProduction ? 'production' : 'development' ;
44
45
@@ -83,6 +84,8 @@ class ScratchWebpackConfigBuilder {
83
84
assetModuleFilename : DEFAULT_ASSET_FILENAME ,
84
85
chunkFilename : DEFAULT_CHUNK_FILENAME ,
85
86
path : this . _distPath ,
87
+ // See https://github.com/scratchfoundation/scratch-editor/pull/25/files/9bc537f9bce35ee327b74bd6715d6c5140f73937#r1763073684
88
+ publicPath,
86
89
library : {
87
90
name : libraryName ,
88
91
type : 'umd2'
0 commit comments