.babelrc
{
"presets": [
["@babel/preset-env", {
"targets": [
"> 1%",
"IE 9",
"not dead"
]
}]
],
"yo!": []
}
package.json
{
"name": "passfather-build",
"version": "1.0.0",
"description": "Build passfather package to most compatibility with browsers and Node.js",
"author": "Evgeny Vyushin <[email protected]> (https://github.com/vyushin)",
"contributors": [
"Evgeny Vyushin <[email protected]> (https://github.com/vyushin)"
],
"maintainers": [
"Evgeny Vyushin <@vyushin.ru> (https://github.com/vyushin)"
],
"repository": {
"type": "git",
"url": "https://github.com/vyushin/passfather/build"
},
"scripts": {
"prebuild": "rm -rf ../dist",
"build": "parcel build ../src/passfather.js --out-dir ../dist/ --out-file passfather.min.js --target browser --no-source-maps --no-cache --global passfather",
"prepublish": "npm run build"
},
"bugs": {
"url": "https://github.com/vyushin/passfather/issues"
},
"homepage": "https://github.com/vyushin/passfather",
"main": "./index.js",
"license": "MIT",
"keywords": [],
"directories": {
"doc": ""
},
"devDependencies": {
"parcel": "^1.12.3"
}
}
cli comman
npx parcel build ../src/passfather.js --out-dir ../dist/ --out-file passfather.min.js --target browser --no-source-maps --no-cache --global passfather
Parcel should make an error because .babelrc is invalid! If Parcel doesn't say anything, how can I be sure that it is using .bebelrc?
Parcel works silently, secretly, whithout messaging any errors.
Don't ignore .babelrc. Original Babel compiler always creates arrors if .babelrc is invalid. Try to use @babel/core. Something like this:
const { transformFileAsync } = require('@babel/core');
transformFileAsync('./test.js', { 'yo!': [] });
you'll see in terminal that property 'yo!' is invalid.
https://github.com/vyushin/passfather/tree/master/build
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.12.3
| Node | 12.4.0
| npm/Yarn | NPM 6.10.2
| Operating System | Windows 10 x64
Parcel currently merges its default babel configuration (preset-env + jsx ...) with the provided babelrc. That could explain this behaviour (Parcel 2 will just use the babelrc without changes).
@mischnic, thanks for answer. Waiting for Parcel 2 :)
Parcel 2 prints:
Error: Unknown option: .yo!. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
Most helpful comment
Parcel currently merges its default babel configuration (preset-env + jsx ...) with the provided babelrc. That could explain this behaviour (Parcel 2 will just use the babelrc without changes).