Skip to content

Commit

Permalink
chore: use cross-env in build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Dec 16, 2022
1 parent 90ff029 commit 2c85805
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/build-core-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let cache;
async function modular({ components }) {
const outputDir = path.resolve(`${getOutput()}`, 'core');
await exec.promise(
`MODULES=esm npx babel src/core --out-dir ${outputDir} --ignore "src/core/icons/**/*.*","src/core/less/*.js","src/core/*.js"`,
`npx cross-env MODULES=esm npx babel src/core --out-dir ${outputDir} --ignore "src/core/icons/**/*.*","src/core/less/*.js","src/core/*.js"`,
);
const removeUMD = (content) => {
return `${content.split('// UMD_ONLY_START')[0]}${content.split('// UMD_ONLY_END')[1] || ''}`;
Expand Down Expand Up @@ -107,7 +107,7 @@ async function modular({ components }) {
for (let fileName of files) {
// eslint-disable-next-line
await exec.promise(
`MODULES=esm npx babel ${outputDir}/${fileName} --out-file ${outputDir}/${fileName}`,
`npx cross-env MODULES=esm npx babel ${outputDir}/${fileName} --out-file ${outputDir}/${fileName}`,
);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function buildReact(cb) {
fs.writeFileSync(`${buildPath}/react/framework7-react.js`, pluginContent);

await exec.promise(
`MODULES=esm npx babel --config-file ./babel-react.config.js src/react --out-dir ${buildPath}/react --ignore "src/react/framework7-react.js","*.ts"`,
`npx cross-env MODULES=esm npx babel --config-file ./babel-react.config.js src/react --out-dir ${buildPath}/react --ignore "src/react/framework7-react.js","*.ts"`,
);

const esmContent = fs.readFileSync(`${buildPath}/react/framework7-react.js`, 'utf-8');
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-svelte.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function buildSvelte(cb) {
fs.writeFileSync(`${buildPath}/svelte/framework7-svelte.js`, pluginContent);

await exec.promise(
`MODULES=esm npx babel --config-file ./babel-svelte.config.js src/svelte --out-dir ${buildPath}/svelte --ignore "src/svelte/framework7-svelte.js","*.svelte"`,
`npx cross-env MODULES=esm npx babel --config-file ./babel-svelte.config.js src/svelte --out-dir ${buildPath}/svelte --ignore "src/svelte/framework7-svelte.js","*.svelte"`,
);

// Copy svelte components
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ async function buildVue(cb) {
fs.writeFileSync(`${buildPath}/vue/framework7-vue.js`, pluginContent);

await exec.promise(
`MODULES=esm npx babel --config-file ./babel-vue.config.js src/vue --out-dir ${buildPath}/vue --ignore "src/vue/framework7-vue.js","*.ts","*.jsx",*jsx --extensions .js`,
`npx cross-env esm npx babel --config-file ./babel-vue.config.js src/vue --out-dir ${buildPath}/vue --ignore "src/vue/framework7-vue.js","*.ts","*.jsx",*jsx --extensions .js`,
);

await exec.promise(
`MODULES=esm npx babel --config-file ./babel-vue.config.js src/vue-temp --out-dir ${buildPath}/vue/components --ignore "src/vue/framework7-vue.js","*.ts","*.jsx",*jsx`,
`npx cross-env MODULES=esm npx babel --config-file ./babel-vue.config.js src/vue-temp --out-dir ${buildPath}/vue/components --ignore "src/vue/framework7-vue.js","*.ts","*.jsx",*jsx`,
);

const esmContent = fs.readFileSync(`${buildPath}/vue/framework7-vue.js`, 'utf-8');
Expand Down

0 comments on commit 2c85805

Please sign in to comment.