0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-08 15:38:03 -05:00

fix dev server externals

This commit is contained in:
liabru 2021-01-31 17:35:57 +00:00
parent b5326f8e49
commit 1f2f9fec45

View file

@ -26,20 +26,29 @@ License ${pkg.license}${!minimize ? '\n\n' + license : ''}`;
const entry = isDevServer ? './demo/js/Server.js' : './src/module/main.js'; const entry = isDevServer ? './demo/js/Server.js' : './src/module/main.js';
const externals = isDevServer ? undefined : { const externals = isDevServer ?
'poly-decomp': { {
commonjs: 'poly-decomp', 'matter-js': {
commonjs2: 'poly-decomp', commonjs: 'matter-js',
amd: 'poly-decomp', commonjs2: 'matter-js',
root: 'decomp' amd: 'matter-js',
}, root: 'Matter'
'matter-wrap': { }
commonjs: 'matter-wrap', } :
commonjs2: 'matter-wrap', {
amd: 'matter-wrap', 'poly-decomp': {
root: 'MatterWrap' commonjs: 'poly-decomp',
} commonjs2: 'poly-decomp',
}; amd: 'poly-decomp',
root: 'decomp'
},
'matter-wrap': {
commonjs: 'matter-wrap',
commonjs2: 'matter-wrap',
amd: 'matter-wrap',
root: 'MatterWrap'
}
};
return { return {
entry: { [name]: entry }, entry: { [name]: entry },
@ -69,7 +78,8 @@ License ${pkg.license}${!minimize ? '\n\n' + license : ''}`;
path.resolve(__dirname, './demo'), path.resolve(__dirname, './demo'),
path.resolve(__dirname, './examples'), path.resolve(__dirname, './examples'),
path.resolve(__dirname, './node_modules/matter-tools/build'), path.resolve(__dirname, './node_modules/matter-tools/build'),
path.resolve(__dirname, './node_modules/pathseg') path.resolve(__dirname, './node_modules/pathseg'),
path.resolve(__dirname, './node_modules/matter-wrap/build')
], ],
watchContentBase: true, watchContentBase: true,
open: true, open: true,
@ -101,6 +111,10 @@ License ${pkg.license}${!minimize ? '\n\n' + license : ''}`;
'/lib/pathseg.js': { '/lib/pathseg.js': {
target: 'http://localhost:8000/', target: 'http://localhost:8000/',
pathRewrite: { '^/lib/pathseg.js' : '/pathseg.js' } pathRewrite: { '^/lib/pathseg.js' : '/pathseg.js' }
},
'/lib/matter-wrap.js': {
target: 'http://localhost:8000/',
pathRewrite: { '^/lib/matter-wrap.js' : '/matter-wrap.js' }
} }
} }
} }