mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Visual Console Client: improved the build system
Former-commit-id: ced96606af3fd36d2d77a2963df7ca70f4174d6e
This commit is contained in:
parent
10cb9c969b
commit
fe61d38686
@ -3,7 +3,10 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Visual Console",
|
"description": "Visual Console",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"clean-build": "node ./scripts/clean-build.js",
|
||||||
|
"prebuild": "npm run clean-build",
|
||||||
"build": "NODE_ENV=production webpack",
|
"build": "NODE_ENV=production webpack",
|
||||||
|
"prebuild:dev": "npm run clean-build",
|
||||||
"build:dev": "NODE_ENV=NODE_ENV=production webpack",
|
"build:dev": "NODE_ENV=NODE_ENV=production webpack",
|
||||||
"build:watch": "NODE_ENV=NODE_ENV=production webpack --watch",
|
"build:watch": "NODE_ENV=NODE_ENV=production webpack --watch",
|
||||||
"format": "prettier",
|
"format": "prettier",
|
||||||
|
10
visual_console/scripts/clean-build.js
Executable file
10
visual_console/scripts/clean-build.js
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
const path = require("path");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const buildPath = path.join(__dirname, "..", "build");
|
||||||
|
|
||||||
|
if (fs.existsSync(buildPath)) {
|
||||||
|
fs.readdirSync(buildPath).forEach(file =>
|
||||||
|
fs.unlinkSync(path.join(buildPath, file))
|
||||||
|
);
|
||||||
|
}
|
@ -6,7 +6,7 @@ module.exports = {
|
|||||||
mode: dev ? "development" : "production",
|
mode: dev ? "development" : "production",
|
||||||
entry: __dirname + "/src/index.ts", // Start from this file.
|
entry: __dirname + "/src/index.ts", // Start from this file.
|
||||||
output: {
|
output: {
|
||||||
path: __dirname + "/dist", // The files will be created here.
|
path: __dirname + "/build", // The files will be created here.
|
||||||
filename: dev
|
filename: dev
|
||||||
? "visual-console-client.min.js"
|
? "visual-console-client.min.js"
|
||||||
: "visual-console-client.[hash].min.js",
|
: "visual-console-client.[hash].min.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user