evocateur / pectin Goto Github PK
View Code? Open in Web Editor NEWRollup-related tools for incremental transpilation of packages in Lerna-based monorepos
License: ISC License
Rollup-related tools for incremental transpilation of packages in Lerna-based monorepos
License: ISC License
having a babel.config.js at the root of the monorepo like so
module.exports = function (api) {
api.cache(true);
const presets = [ ... ];
const plugins = [ ... ];
return {
presets,
plugins
};
}
results in the following errors
Error: At least one preset (like @babel/preset-env) is required in ../../babel.config.js
pectin
assumes that babel.config.js
will be written as so
module.exports = {
presets: [ ... ],
};
Is it possible to provide a argument flag that output errors from rollup
instead of the
"pectin info skipping packages unchanged since last build" message.
I know there is a TODO on that piece of code, but just checking in case there is alternative.
With --experimentalCodeSplitting
, rollup will output multiple files when you use dynamic import. Currently, the code splitting target has to be a separate package or it'll just get inlined.
Can that flag be enabled, or should it wait until rollup 1.0 lands?
I tested this locally and it does correctly create multiple files within a package. I'm not sure how it'll work in commonjs-land, but rollup 1.0 makes code splitting on by default so it'll have to work if we want to upgrade to that.
Or at the very least an example lerna project
Hi ๐,
Babel v7.0.0 (stable) just got released, it would be nice to support it.
You can find migration instructions here: https://babeljs.io/docs/en/v7-migration
Thank you!
I'm in a case where tests and source code are both using imports (ES6 syntax). pectin wants modules to be set to false while mocha want them to be true.
Babel supports multiple envs in the babelrc config file, so supporting it in pectin would be great.
I'm currently using node v13.10.1, babel 6 and pectin ^3.6.1
PS: any other suggestions for me to do this in a "better" way are also welcome ๐
.babelrc file
{
"env": {
"test": {
"presets": [
[
"env",
{
"targets": {
"node": "current"
}
}
]
]
},
"build": {
"presets": [
[
"env",
{
"modules": false,
"targets": {
"node": "current"
}
}
]
]
}
}
}
sample app.js
export function foo () {
return 'bar'
}
sample test.spec.js
import { foo } from '../src/app'
describe('testing app', () => {
it('should return bar', function () {
expect(foo()).to.deep.equal('bar')
})
})
mocha.opts
--require babel-core/register
--require babel-register
--require test/setup.js
--recursive
Just documenting our conversation, but it would be nice as a consumer of pectin packages to have source maps available locally.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.