Remove useless commandLineArgs.input manipulation

This commit is contained in:
Alice Gaudon 2021-04-27 15:00:43 +02:00
parent 7b2cdb8269
commit 4f1f88c8f8

View File

@ -12,59 +12,54 @@ const buildDir = process.env.BUILD_DIR;
const publicDir = process.env.PUBLIC_DIR; const publicDir = process.env.PUBLIC_DIR;
const input = process.env.INPUT.split(':'); const input = process.env.INPUT.split(':');
export default commandLineArgs => { export default commandLineArgs => ({
const type = commandLineArgs.input; input: input,
delete commandLineArgs.input; output: {
sourcemap: true,
return { format: 'es',
input: input, name: 'bundle',
output: { dir: path.join(publicDir, 'js'),
sourcemap: true, entryFileNames: (chunkInfo) => {
format: 'es', const name = chunkInfo.facadeModuleId ?
name: 'bundle', path.relative(buildDir, chunkInfo.facadeModuleId) :
dir: path.join(publicDir, 'js'), chunkInfo.name;
entryFileNames: (chunkInfo) => { return name + '.js';
const name = chunkInfo.facadeModuleId ?
path.relative(buildDir, chunkInfo.facadeModuleId) :
chunkInfo.name;
return name + '.js';
},
}, },
plugins: [ },
svelte({ plugins: [
preprocess: sveltePreprocess({ svelte({
typescript: { preprocess: sveltePreprocess({
tsconfigFile: 'tsconfig.views.json', typescript: {
}, tsconfigFile: 'tsconfig.views.json',
}),
compilerOptions: {
dev: !production,
hydratable: true,
}, },
}), }),
compilerOptions: {
dev: !production,
hydratable: true,
},
}),
// Extract css into separate files // Extract css into separate files
cssOnlyRollupPlugin({output: 'bundle.css'}), cssOnlyRollupPlugin({output: 'bundle.css'}),
// If you have external dependencies installed from // If you have external dependencies installed from
// npm, you'll most likely need these plugins. In // npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration - // some cases you'll need additional configuration -
// consult the documentation for details: // consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs // https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({ resolve({
browser: true, browser: true,
dedupe: ['svelte'], dedupe: ['svelte'],
}), }),
commonjs(), commonjs(),
// Live reload in dev // Live reload in dev
!production && !!commandLineArgs.watch && livereloadRollupPlugin('public'), !production && !!commandLineArgs.watch && livereloadRollupPlugin('public'),
// Minify in production // Minify in production
production && terser(), production && terser(),
], ],
watch: { watch: {
clearScreen: false, clearScreen: false,
}, },
}; });
};