Skip to content

Commit

Permalink
chore(build): es5 compatibility for browser (#5560)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Nov 28, 2018
1 parent 4dd7c79 commit bd38340
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .azure-pipelines/lint-dist.yml
@@ -0,0 +1,14 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(node_version)"
displayName: "Install Node.js"

- script: yarn install --frozen-lockfile
displayName: "Install dependencies"

- script: yarn build
displayName: "Build dist"

- script: yarn lint-dist
displayName: "Lint dist"
9 changes: 9 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -16,6 +16,15 @@ jobs:
steps:
- template: .azure-pipelines/lint.yml

- job: Lint_Dist_Linux_Node_v10
displayName: Lint Dist on Linux Node v10
pool:
vmImage: "Ubuntu 16.04"
variables:
node_version: 10
steps:
- template: .azure-pipelines/lint-dist.yml

- job: Dev_Test_Windows_Node_v10
displayName: Dev Tests on Windows Node v10
pool:
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -129,6 +129,7 @@
"perf-benchmark": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js --debug-benchmark --loglevel debug ${PERF_FILE:-./index.js} > /dev/null",
"lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter",
"lint-docs": "prettylint {.,docs,website,website/blog}/*.md",
"lint-dist": "eslint --no-eslintrc --no-ignore --env=browser \"dist/!(bin-prettier|index|third-party).js\"",
"build": "node --max-old-space-size=2048 ./scripts/build/build.js",
"build-docs": "node ./scripts/build-docs.js",
"check-deps": "node ./scripts/check-deps.js"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/build.js
Expand Up @@ -99,7 +99,7 @@ async function run(params) {
await execa("rm", ["-rf", ".cache"]);
}

const bundleCache = new Cache(".cache/", "v7");
const bundleCache = new Cache(".cache/", "v8");
await bundleCache.load();

console.log(chalk.inverse(" Building packages "));
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/rollup-plugins/evaluate.js
Expand Up @@ -20,7 +20,7 @@ module.exports = function() {
);

return {
code: `const json = ${json}; export default json;`,
code: `var json = ${json}; export default json;`,
map: { mappings: "" }
};
}
Expand Down

0 comments on commit bd38340

Please sign in to comment.