-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modularization and more organized project structure #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this is fine.
But I wonder if we can remove the dist code from the repo and just publish it to NPM?
You are absolutely right, they are totally unnecessary, I've just removed them. |
package.json
Outdated
"test": "npm run build:umd-polyfill && headless-test --cors test.js", | ||
"closure": "google-closure-compiler --js=src/*.js --checks_only --module_resolution=node --compilation_level=ADVANCED", | ||
"build": "run-p build:**", | ||
"build:cjs": "rollup -i src/index.js -o lib/index.js -f cjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could write a set of configuration in a single rollup.config.js
file, rather than make a series npm scripts to do the same things:
export default {
{
input: 'src/index.js',
output: [
{
file: 'lib/index.js',
format: 'cjs'
},
{
file: 'es/index.js',
format: 'es'
}
]
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so your build script can simplified to one line command "build": "rollup"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool cool, didn't know that. Just updated the rollup config.
output: [ | ||
{ | ||
file: 'dist/polyfill.js', | ||
format: 'umd' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not convinced anyone actually wants umd
, but there's probably no harm in it.
I guess I am a bit confused why umd
doesn't get the document setup stuff that's in index.
First PR of a series of changes proposed in #15, sorry for such delay. Modularization for portability and accessibility. Reorganizes project structure, and switches to
rollup
as the builder to provide bothcjs
andumd
outputs and better workflow for future development.