mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
ensure dynamic imports use proper path/url
This commit is contained in:
+10
-4
@@ -54,7 +54,7 @@ const config = {
|
||||
target: 'web',
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
publicPath: '/static/',
|
||||
publicPath: '',
|
||||
filename: '[name].js',
|
||||
chunkFilename: '[name].chunk.js',
|
||||
},
|
||||
@@ -249,13 +249,19 @@ const applyConfig = (entries, root = {}) =>
|
||||
config,
|
||||
{
|
||||
entry: entries.reduce(
|
||||
(entry, { name, path, disablePolyfill = false }) => {
|
||||
(entry, { name, path: modulePath, disablePolyfill = false }) => {
|
||||
const entries = [
|
||||
path.join(__dirname, 'client/coral-framework/helpers/publicPath'),
|
||||
];
|
||||
if (disablePolyfill) {
|
||||
entry[name] = path;
|
||||
entries.push(modulePath);
|
||||
} else {
|
||||
entry[name] = ['babel-polyfill', path];
|
||||
entries.unshift('babel-polyfill');
|
||||
entries.push(modulePath);
|
||||
}
|
||||
|
||||
entry[name] = entries;
|
||||
|
||||
return entry;
|
||||
},
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user