mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 11:15:14 +00:00
Fix rollup input paths on Windows
This commit is contained in:
@@ -15,6 +15,13 @@ export default async function create_compilers(bundler: 'rollup' | 'webpack'): P
|
||||
const config = await RollupCompiler.load_config();
|
||||
validate_config(config, 'rollup');
|
||||
|
||||
normalize_rollup_config(config.client);
|
||||
normalize_rollup_config(config.server);
|
||||
|
||||
if (config.serviceworker) {
|
||||
normalize_rollup_config(config.serviceworker);
|
||||
}
|
||||
|
||||
return {
|
||||
client: new RollupCompiler(config.client),
|
||||
server: new RollupCompiler(config.server),
|
||||
@@ -41,4 +48,14 @@ function validate_config(config: any, bundler: 'rollup' | 'webpack') {
|
||||
if (!config.client || !config.server) {
|
||||
throw new Error(`${bundler}.config.js must export a { client, server, serviceworker? } object`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function normalize_rollup_config(config: any) {
|
||||
if (typeof config.input === 'string') {
|
||||
config.input = path.normalize(config.input);
|
||||
} else {
|
||||
for (const name in config.input) {
|
||||
config.input[name] = path.normalize(config.input[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user