Skip to content

Commit fb3ab8b

Browse files
Added webpack to simplr-validation.
1 parent 23a558e commit fb3ab8b

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

packages/simplr-validation/package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
"scripts": {
1111
"test": "jest",
1212
"test-watch": "jest --watchAll",
13-
"test-coverage": "npm test -- --coverage"
13+
"test-coverage": "npm test -- --coverage",
14+
"build": "webpack && npm run tslint",
15+
"watch": "webpack -w",
16+
"release": "npm run build && npm run uglifyjs",
17+
"tslint": "tslint --config ./tslint.json --project . --exclude __tests__/**/* && echo TsLint test successfully passed.",
18+
"uglifyjs": "uglifyjs ./dist/simplr-forms-core.js -o ./dist/simplr-forms-core.min.js --compress --mangle"
1419
},
1520
"license": "AGPL-3.0",
1621
"files": [
@@ -30,8 +35,11 @@
3035
"react-test-renderer": "^15.5.4",
3136
"sinon": "^2.1.0",
3237
"ts-jest": "^19.0.8",
38+
"ts-loader": "^2.0.3",
3339
"tslint": "^5.0.0",
34-
"typescript": "2.3.0"
40+
"typescript": "2.3.0",
41+
"uglifyjs": "^2.4.10",
42+
"webpack": "^2.4.1"
3543
},
3644
"dependencies": {
3745
"@types/react": "^15.0.21",
@@ -55,4 +63,4 @@
5563
"js"
5664
]
5765
}
58-
}
66+
}

packages/simplr-validation/src/subscribers/form-store-subscriber.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from "React";
1+
import * as React from "react";
22
import { Stores, Actions, Contracts as FormsCoreContracts } from "simplr-forms-core";
33
import * as ActionEmitter from "action-emitter";
44

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const packageJson = require("./package.json");
2+
3+
let externals = {};
4+
5+
for (let key in packageJson.dependencies) {
6+
externals[key] = key;
7+
}
8+
9+
module.exports = {
10+
entry: "./src/index.ts",
11+
output: {
12+
filename: "./dist/simplr-validation.js",
13+
libraryTarget: "umd"
14+
},
15+
module: {
16+
rules: [
17+
{
18+
test: /\.tsx?$/,
19+
loader: "ts-loader",
20+
options: {
21+
}
22+
}
23+
]
24+
},
25+
resolve: {
26+
extensions: [".ts", ".tsx"]
27+
},
28+
externals: externals
29+
};

0 commit comments

Comments
 (0)