Skip to content
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

Merged
merged 1 commit into from
Sep 21, 2016
Merged

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Sep 20, 2016

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.

image

@codecov-io
Copy link

codecov-io commented Sep 20, 2016

Current coverage is 98.74% (diff: 100%)

Merging #518 into master will increase coverage by <.01%

@@             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          

Powered by Codecov. Last update 5564d44...2868fcb

@@ -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
Copy link
Member Author

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"]
},
Copy link
Member Author

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) => {
Copy link
Member Author

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",
Copy link
Member Author

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.

...elements,
...modules,
...views,
version,
Copy link
Member Author

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.

@levithomason levithomason force-pushed the feature/browser-build branch 2 times, most recently from 27d0c85 to fa24d19 Compare September 20, 2016 23:49
@levithomason levithomason merged commit 1a874fe into master Sep 21, 2016
@levithomason levithomason deleted the feature/browser-build branch September 21, 2016 01:20
@levithomason
Copy link
Member Author

Released in stardust@0.45.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants