-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
chore(build): add browser build #518
Conversation
45eac5a
to
1456fd0
Compare
Current coverage is 98.74% (diff: 100%)@@ master #518 diff @@
==========================================
Files 106 107 +1
Lines 1753 1754 +1
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1731 1732 +1
Misses 22 22
Partials 0 0
|
@@ -6,7 +6,7 @@ if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') { | |||
// Safari private mode throws when writing to localStorage | |||
// https://github.com/TechnologyAdvice/stardust/issues/332 | |||
try { | |||
if (typeof localStorage === 'object') localStorage.debug = localStorage.debug || 'stardust:*' | |||
if (typeof localStorage === 'object') localStorage.debug = localStorage.debug || null |
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.
Made debug info opt-in as it is extremely noisy.
@@ -8,6 +8,9 @@ | |||
"lodash" | |||
], | |||
"env": { | |||
"browser": { | |||
"plugins": ["add-module-exports"] | |||
}, |
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.
We need module exports for the window object, prevents us from having to do stardust.default.Button
.
task('webpack-docs', (cb) => { | ||
const webpackConfig = require('../../webpack.config') | ||
const compiler = webpack(webpackConfig) | ||
task('build:docs:dll', (cb) => { |
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 properly named the gulp tasks.
"docs": "gulp docs", | ||
"build": "npm run build:commonjs && npm run build:docs", | ||
"prebuild:commonjs": "rimraf dist/commonjs", | ||
"build:commonjs": "babel src -d dist/commonjs", |
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 split up the commonjs (npm) build from the umd (browser) build.
1456fd0
to
35292e0
Compare
...elements, | ||
...modules, | ||
...views, | ||
version, |
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've added the package version to the exported object. Available in the browser and in the commonjs build.
27d0c85
to
fa24d19
Compare
fa24d19
to
2868fcb
Compare
Released in |
This PR adds a browser build. It will be used in online editors (jsFiddle, Codepen, etc.) for bug reports. We may also find use for this build in v2 of the doc site.