fix: args and cleaning
This commit is contained in:
parent
e69639a858
commit
0f04e43132
|
@ -8,8 +8,7 @@
|
|||
"latus-build": "./build.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "LATUS_POSTCSS_CONFIG=./src/build/postcss.config.js NODE_PATH=./node_modules webpack --config ./webpack.config.js --mode production",
|
||||
"clean": "rm -rf yarn.lock node_modules/* $(node -e \"process.stdout.write(require('./package.json').files.filter((file) => {const parts = file.split('/'); return 1 === parts.length || 'test' !== parts[0];}).join(' '));\")",
|
||||
"build": "LATUS_POSTCSS_CONFIG=./src/build/postcss.config.js LATUS_WEBPACK_CONFIG=./src/build/webpack.config.js NODE_PATH=./node_modules webpack --config ./webpack.config.js --mode production",
|
||||
"fp": "npm unpublish --force $(node -e 'const {name, version} = require(`./package.json`); process.stdout.write(`${name}@${version}`)') && npm publish",
|
||||
"lint": "NODE_PATH=./node_modules eslint --config ./.eslintrc.js --format codeframe --ext mjs,js .",
|
||||
"test": "yarn --silent run build --display none && mocha --colors test.js"
|
||||
|
|
|
@ -70,16 +70,25 @@ const clean = () => {
|
|||
rimraf.sync(join(cwd, 'node_modules', '*'));
|
||||
rimraf.sync(join(cwd, 'yarn.lock'));
|
||||
const {files} = __non_webpack_require__(join(cwd, 'package.json'));
|
||||
if (files && files.length > 0) {
|
||||
rimraf.sync(
|
||||
files
|
||||
.map((filename) => join(cwd, filename))
|
||||
.join(' '),
|
||||
);
|
||||
}
|
||||
spawn(
|
||||
'yarn',
|
||||
[],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
program
|
||||
.command('clean')
|
||||
.description('remove node_modules, yarn.lock, and build artifacts')
|
||||
.description('remove node_modules, yarn.lock, and build artifacts and run yarn')
|
||||
.action(clean);
|
||||
|
||||
const unpublish = async () => {
|
||||
|
@ -162,6 +171,7 @@ program
|
|||
.action(lint);
|
||||
|
||||
const test = async () => {
|
||||
process.argv.splice(2, 1);
|
||||
await build(['--display', 'none']);
|
||||
const {production} = program.opts();
|
||||
const configFile = localConfig('.eslintrc.js');
|
||||
|
|
Loading…
Reference in New Issue
Block a user