Skip to content

Commit e7c436f

Browse files
Merge pull request #72 from remarkablemark/build/package
Update build and dependencies
2 parents 9de3e12 + 5b849ee commit e7c436f

File tree

3 files changed

+27
-42
lines changed

3 files changed

+27
-42
lines changed

.travis.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
language: node_js
2-
32
node_js:
4-
- stable
5-
6-
sudo: false # https://docs.travis-ci.com/user/migrating-from-legacy/
7-
3+
- stable
84
install:
9-
- npm install
10-
5+
- npm install
116
script:
12-
- npm run lint
13-
- npm run cover
14-
7+
- npm run lint
8+
- npm run cover
9+
- npm run build
1510
after_script:
16-
- npm run coveralls
17-
11+
- npm run coveralls
1812
cache:
19-
directories:
20-
- node_modules
21-
13+
directories:
14+
- node_modules
2215
notifications:
23-
email: false
16+
email: false

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
"author": "Mark <mark@remarkablemark.org>",
66
"main": "index.js",
77
"scripts": {
8-
"build:unmin": "NODE_ENV=development webpack index.js dist/html-react-parser.js",
9-
"build:min": "NODE_ENV=production webpack -p index.js dist/html-react-parser.min.js",
8+
"build": "npm run clean && npm run build:min && npm run build:unmin",
9+
"build:min": "NODE_ENV=production webpack -o dist/html-react-parser.min.js",
10+
"build:unmin": "NODE_ENV=development webpack -o dist/html-react-parser.js",
1011
"clean": "rm -rf dist",
1112
"commitmsg": "commitlint -e $GIT_PARAMS",
1213
"cover": "istanbul cover _mocha -- -R spec \"test/**/*\"",
1314
"coveralls": "cat coverage/lcov.info | coveralls",
1415
"lint": "eslint --ignore-path .gitignore .",
1516
"lint:fix": "npm run lint -- --fix",
1617
"precommit": "lint-staged",
17-
"prepublishOnly": "npm run clean && npm run build:unmin && npm run build:min",
18+
"prepublishOnly": "npm run build",
1819
"release": "standard-version --no-verify",
1920
"test": "mocha",
20-
"test:benchmark": "node ./test/benchmark.js"
21+
"test:benchmark": "node test/benchmark.js"
2122
},
2223
"repository": {
2324
"type": "git",
@@ -36,14 +37,14 @@
3637
"dependencies": {
3738
"html-dom-parser": "0.1.3",
3839
"react-dom-core": "0.0.3",
39-
"style-to-object": "0.2.1"
40+
"style-to-object": "0.2.2"
4041
},
4142
"devDependencies": {
42-
"@commitlint/cli": "^6.1.0",
43-
"@commitlint/config-conventional": "^6.1.0",
43+
"@commitlint/cli": "^7.1.2",
44+
"@commitlint/config-conventional": "^7.1.2",
4445
"benchmark": "2.1.4",
4546
"coveralls": "^3.0.0",
46-
"eslint": "^4.18.0",
47+
"eslint": "^5.5.0",
4748
"eslint-plugin-prettier": "^2.6.0",
4849
"husky": "^0.14.3",
4950
"istanbul": "^0.4.5",
@@ -53,7 +54,8 @@
5354
"react": "^16",
5455
"react-dom": "^16",
5556
"standard-version": "^4.3.0",
56-
"webpack": "^3.11.0"
57+
"webpack": "^4.19.0",
58+
"webpack-cli": "^3.1.0"
5759
},
5860
"peerDependencies": {
5961
"react": "^0.14 || ^15 || ^16"

webpack.config.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
1-
'use strict';
1+
var path = require('path');
22

33
/**
4-
* Module dependencies.
5-
*/
6-
var webpack = require('webpack');
7-
8-
/**
9-
* Export webpack configuration.
4+
* Webpack configuration.
105
*/
116
module.exports = {
7+
entry: path.resolve(__dirname, 'index.js'),
128
output: {
139
library: 'HTMLReactParser',
1410
libraryTarget: 'umd'
1511
},
1612
externals: {
1713
react: {
18-
root: 'React',
19-
commonjs2: 'react',
14+
amd: 'react',
2015
commonjs: 'react',
21-
amd: 'react'
16+
commonjs2: 'react',
17+
root: 'React'
2218
}
2319
},
24-
plugins: [
25-
new webpack.optimize.ModuleConcatenationPlugin(),
26-
new webpack.optimize.OccurrenceOrderPlugin(),
27-
new webpack.DefinePlugin({
28-
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
29-
})
30-
]
20+
mode: process.env.NODE_ENV
3121
};

0 commit comments

Comments
 (0)