Skip to content

Use webpack to build UMD bundle #22

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

Merged
merged 7 commits into from
Sep 27, 2016
Merged

Use webpack to build UMD bundle #22

merged 7 commits into from
Sep 27, 2016

Conversation

remarkablemark
Copy link
Owner

@remarkablemark remarkablemark commented Sep 26, 2016

As an improvement of #6 and #9, let webpack handle building the UMD bundle. Build inspired by react-router.

The bundle will be generated in the ./dist/ directory as html-react-parser.js and html-react-parser.min.js.

Tasks:

  • Create npm scripts:
    • build: Builds development/unminified bundle
    • build-min: Builds production/minified bundle
    • prepublish: Runs build and build-min before publish
  • Save [email protected] and create webpack.config.js
  • Add dist to .gitignore

Follow standard config:
https://webpack.github.io/docs/configuration.html

Export to `./dist/html-react-parser.min.js`

Specify `react` in "externals":
https://github.com/webpack/webpack/tree/master/examples/externals
npm scripts:
- build (unminified UMD bundle)
- build-min (minified UMD bundle)

`webpack.config.js`:
- Remove "entry" and "output.filename" now that paths are passed
  via CLI
Remove branches where `process.env.NODE_ENV !== "production"`
especially for React.
Build the unminified and minified client-side bundles before
publish.
@remarkablemark remarkablemark added the feature New feature or request label Sep 26, 2016
@remarkablemark remarkablemark self-assigned this Sep 26, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+5.2%) to 94.872% when pulling 22453d0 on webpack into 1774d2c on master.

@remarkablemark remarkablemark merged commit 646b4a8 into master Sep 27, 2016
@remarkablemark remarkablemark deleted the webpack branch September 27, 2016 01:47
remarkablemark added a commit that referenced this pull request Sep 27, 2016
- Update README (#17 and #21):
  - Improve documentation of `replace` option with the help of
    @poacher2k
  - Tidy and reword some parts
- Use webpack to build UMD bundle (#22)
  - Build to `./dist/` directory before publish
- Fix regex bug on client parser (#24)
  - Add test for `window.DOMParser`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants