-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from remarkablemark/build/package
Update build and dependencies
- Loading branch information
Showing
3 changed files
with
27 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- stable | ||
|
||
sudo: false # https://docs.travis-ci.com/user/migrating-from-legacy/ | ||
|
||
- stable | ||
install: | ||
- npm install | ||
|
||
- npm install | ||
script: | ||
- npm run lint | ||
- npm run cover | ||
|
||
- npm run lint | ||
- npm run cover | ||
- npm run build | ||
after_script: | ||
- npm run coveralls | ||
|
||
- npm run coveralls | ||
cache: | ||
directories: | ||
- node_modules | ||
|
||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,20 @@ | |
"author": "Mark <[email protected]>", | ||
"main": "index.js", | ||
"scripts": { | ||
"build:unmin": "NODE_ENV=development webpack index.js dist/html-react-parser.js", | ||
"build:min": "NODE_ENV=production webpack -p index.js dist/html-react-parser.min.js", | ||
"build": "npm run clean && npm run build:min && npm run build:unmin", | ||
"build:min": "NODE_ENV=production webpack -o dist/html-react-parser.min.js", | ||
"build:unmin": "NODE_ENV=development webpack -o dist/html-react-parser.js", | ||
"clean": "rm -rf dist", | ||
"commitmsg": "commitlint -e $GIT_PARAMS", | ||
"cover": "istanbul cover _mocha -- -R spec \"test/**/*\"", | ||
"coveralls": "cat coverage/lcov.info | coveralls", | ||
"lint": "eslint --ignore-path .gitignore .", | ||
"lint:fix": "npm run lint -- --fix", | ||
"precommit": "lint-staged", | ||
"prepublishOnly": "npm run clean && npm run build:unmin && npm run build:min", | ||
"prepublishOnly": "npm run build", | ||
"release": "standard-version --no-verify", | ||
"test": "mocha", | ||
"test:benchmark": "node ./test/benchmark.js" | ||
"test:benchmark": "node test/benchmark.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -36,14 +37,14 @@ | |
"dependencies": { | ||
"html-dom-parser": "0.1.3", | ||
"react-dom-core": "0.0.3", | ||
"style-to-object": "0.2.1" | ||
"style-to-object": "0.2.2" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^6.1.0", | ||
"@commitlint/config-conventional": "^6.1.0", | ||
"@commitlint/cli": "^7.1.2", | ||
"@commitlint/config-conventional": "^7.1.2", | ||
"benchmark": "2.1.4", | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.18.0", | ||
"eslint": "^5.5.0", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"husky": "^0.14.3", | ||
"istanbul": "^0.4.5", | ||
|
@@ -53,7 +54,8 @@ | |
"react": "^16", | ||
"react-dom": "^16", | ||
"standard-version": "^4.3.0", | ||
"webpack": "^3.11.0" | ||
"webpack": "^4.19.0", | ||
"webpack-cli": "^3.1.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^0.14 || ^15 || ^16" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
var webpack = require('webpack'); | ||
|
||
/** | ||
* Export webpack configuration. | ||
* Webpack configuration. | ||
*/ | ||
module.exports = { | ||
entry: path.resolve(__dirname, 'index.js'), | ||
output: { | ||
library: 'HTMLReactParser', | ||
libraryTarget: 'umd' | ||
}, | ||
externals: { | ||
react: { | ||
root: 'React', | ||
commonjs2: 'react', | ||
amd: 'react', | ||
commonjs: 'react', | ||
amd: 'react' | ||
commonjs2: 'react', | ||
root: 'React' | ||
} | ||
}, | ||
plugins: [ | ||
new webpack.optimize.ModuleConcatenationPlugin(), | ||
new webpack.optimize.OccurrenceOrderPlugin(), | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
}) | ||
] | ||
mode: process.env.NODE_ENV | ||
}; |