Skip to content

Commit

Permalink
Merge pull request #72 from remarkablemark/build/package
Browse files Browse the repository at this point in the history
Update build and dependencies
  • Loading branch information
remarkablemark authored Sep 14, 2018
2 parents 9de3e12 + 5b849ee commit e7c436f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 42 deletions.
25 changes: 9 additions & 16 deletions .travis.yml
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
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
Expand Down
24 changes: 7 additions & 17 deletions webpack.config.js
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
};

0 comments on commit e7c436f

Please sign in to comment.