Remove useless commandLineArgs.input manipulation

This commit is contained in:
Alice Gaudon 2021-04-27 15:00:43 +02:00
parent 7b2cdb8269
commit 4f1f88c8f8
1 changed files with 44 additions and 49 deletions

View File

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