Skip to content

Commit

Permalink
build: generalize ignore patter to include all '__*__' dirs (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Apr 25, 2019
1 parent 86f6e82 commit 294eba2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .babelrc.js
@@ -1,3 +1,6 @@
//ignore all "__*__" directories, e.g. __tests__, __fixtures__
const ignore = [/\/__[^/]*__\//]; // **/__*__

module.exports = {
presets: ['@babel/preset-env'],
plugins: [
Expand All @@ -12,11 +15,13 @@ module.exports = {
presets: [
['@babel/preset-env', { modules: 'commonjs' }],
],
ignore,
},
mjs: {
presets: [
['@babel/preset-env', { modules: false }],
],
ignore,
},
},
};
7 changes: 3 additions & 4 deletions package.json
Expand Up @@ -36,10 +36,9 @@
"build:clean": "rm -rf ./dist && mkdir ./dist",
"build:cp": "cp README.md LICENSE ./dist",
"build:package-json": "node ./resources/copy-package-json.js",
"build:js": "babel src --ignore 'src/__fixtures__,**/__tests__'",
"build:cjs": "npm run build:js -- --env-name cjs --out-dir dist/",
"build:mjs": "npm run build:js -- --env-name mjs --out-dir dist/module && for file in $(find dist/module -name '*.js'); do mv \"$file\" `echo \"$file\" | sed 's/dist\\/module/dist/g; s/.js$/.mjs/g'`; done && rm -rf dist/module",
"build:flow": "for file in $(find ./src -name '*.js' -not -path '*/__fixtures__*' -not -path '*/__tests__*'); do cp \"$file\" `echo \"$file\" | sed 's/\\/src\\//\\/dist\\//g'`.flow; done",
"build:cjs": "babel src --env-name cjs --out-dir dist/",
"build:mjs": "babel src --env-name mjs --out-dir dist/module && for file in $(find dist/module -name '*.js'); do mv \"$file\" `echo \"$file\" | sed 's/dist\\/module/dist/g; s/.js$/.mjs/g'`; done && rm -rf dist/module",
"build:flow": "for file in $(find ./src -name '*.js' -not -path '*/__*__*'); do cp \"$file\" `echo \"$file\" | sed 's/\\/src\\//\\/dist\\//g'`.flow; done",
"preversion": ". ./resources/checkgit.sh && npm test",
"prepublishOnly": ". ./resources/prepublish.sh",
"gitpublish": ". ./resources/gitpublish.sh"
Expand Down

0 comments on commit 294eba2

Please sign in to comment.