mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] devtools: Fix build commands for windows users
This commit adapts the commands used and the rollup file to be compatible with windows console commands syntax.
This commit is contained in:
committed by
Géry Debongnie
parent
afd7f957df
commit
aa19897031
+2
-2
@@ -19,8 +19,8 @@
|
|||||||
"build:devtools": "rollup -c ./tools/devtools/rollup.config.js",
|
"build:devtools": "rollup -c ./tools/devtools/rollup.config.js",
|
||||||
"dev:devtools-chrome": "npm run build:devtools -- --config-browser=chrome",
|
"dev:devtools-chrome": "npm run build:devtools -- --config-browser=chrome",
|
||||||
"dev:devtools-firefox": "npm run build:devtools -- --config-browser=firefox",
|
"dev:devtools-firefox": "npm run build:devtools -- --config-browser=firefox",
|
||||||
"build:devtools-chrome": "NODE_ENV=production npm run dev:devtools-chrome",
|
"build:devtools-chrome": "npm run dev:devtools-chrome -- --config-env=production",
|
||||||
"build:devtools-firefox": "NODE_ENV=production npm run dev:devtools-firefox",
|
"build:devtools-firefox": "npm run dev:devtools-firefox -- --config-env=production",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand --watch --testTimeout=5000000",
|
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand --watch --testTimeout=5000000",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import execute from "rollup-plugin-execute";
|
|||||||
import del from "rollup-plugin-delete";
|
import del from "rollup-plugin-delete";
|
||||||
import { string } from "rollup-plugin-string";
|
import { string } from "rollup-plugin-string";
|
||||||
|
|
||||||
export default ({ "config-browser": browser }) => {
|
const isWindows = process.platform === "win32";
|
||||||
const isProduction = process.env.NODE_ENV === "production";
|
|
||||||
|
export default ({ "config-browser": browser, "config-env": env }) => {
|
||||||
|
const isProduction = env === "production";
|
||||||
const isChrome = browser === "chrome";
|
const isChrome = browser === "chrome";
|
||||||
const filesToMove = [
|
const filesToMove = [
|
||||||
{ src: "tools/devtools/assets/**/*", dest: "dist/devtools/assets/" },
|
{ src: "tools/devtools/assets/**/*", dest: "dist/devtools/assets/" },
|
||||||
@@ -53,13 +55,19 @@ export default ({ "config-browser": browser }) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
const commands = new Array(2);
|
const commands = new Array(2);
|
||||||
commands[1] =
|
commands[1] = isWindows
|
||||||
"npm run compile_templates -- tools/devtools/src && mv templates.js tools/devtools/assets/templates.js";
|
? "npm run compile_templates -- tools\\devtools\\src && move templates.js tools\\devtools\\assets\\templates.js"
|
||||||
|
: "npm run compile_templates -- tools/devtools/src && mv templates.js tools/devtools/assets/templates.js";
|
||||||
const firstRule = generateRule("tools/devtools/src/page_scripts/owl_devtools_global_hook.js");
|
const firstRule = generateRule("tools/devtools/src/page_scripts/owl_devtools_global_hook.js");
|
||||||
if (isProduction)
|
if (isProduction) {
|
||||||
commands[0] =
|
commands[0] = isWindows
|
||||||
"npm run build && cp dist/owl.iife.js tools/devtools/assets/owl.js && npm run build:compiler";
|
? "npm run build && copy dist\\owl.iife.js tools\\devtools\\assets\\owl.js && npm run build:compiler"
|
||||||
else commands[0] = "cp dist/owl.iife.js tools/devtools/assets/owl.js";
|
: "npm run build && cp dist/owl.iife.js tools/devtools/assets/owl.js && npm run build:compiler";
|
||||||
|
} else {
|
||||||
|
commands[0] = isWindows
|
||||||
|
? "copy dist\\owl.iife.js tools\\devtools\\assets\\owl.js"
|
||||||
|
: "cp dist/owl.iife.js tools/devtools/assets/owl.js";
|
||||||
|
}
|
||||||
firstRule.plugins.push(execute(commands, true));
|
firstRule.plugins.push(execute(commands, true));
|
||||||
const secondRule = generateRule("tools/devtools/src/content.js");
|
const secondRule = generateRule("tools/devtools/src/content.js");
|
||||||
secondRule.plugins.push(copy({ targets: filesToMove }));
|
secondRule.plugins.push(copy({ targets: filesToMove }));
|
||||||
|
|||||||
Reference in New Issue
Block a user