Skip to content

Commit 4f28c70

Browse files
committed
Improved project structure
1 parent 0ffe9a3 commit 4f28c70

File tree

8 files changed

+161
-162
lines changed

8 files changed

+161
-162
lines changed
File renamed without changes.

src/index.js renamed to dist/aspnet-validation.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/aspnet-validation.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "aspnet-validation",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Enables ASP.NET Core MVC client-side validation, without JQuery!",
5-
"main": "./src/index.js",
6-
"types": "./src/index.d.ts",
5+
"main": "./dist/aspnet-validation.js",
6+
"types": "./@types/index.d.ts",
77
"repository": "https://github.com/ryanelian/aspnet-validation",
88
"bugs": {
99
"url": "https://github.com/ryanelian/aspnet-validation/issues"
@@ -15,10 +15,8 @@
1515
"build": "webpack && webpack --config webpack.config.min.js"
1616
},
1717
"devDependencies": {
18-
"source-map-loader": "^0.2.1",
19-
"ts-loader": "^2.3.2",
20-
"typescript": "^2.4.2",
21-
"uglifyjs-webpack-plugin": "^0.4.6",
22-
"webpack": "^3.4.1"
18+
"ts-loader": "^3.0.2",
19+
"typescript": "^2.5.3",
20+
"webpack": "^3.8.1"
2321
}
2422
}

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"target": "es5",
1515
"module": "es2015",
1616
"moduleResolution": "node",
17-
"sourceMap": true,
18-
"declaration": true,
17+
"noEmit": true,
1918

2019
"lib": [
2120
"dom",

webpack.config.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1+
let tsconfigOverride = {
2+
declaration: true,
3+
declarationDir: '@types',
4+
sourceMap: false,
5+
noEmit: false
6+
};
7+
18
module.exports = {
29
entry: "./src/index.ts",
310
output: {
4-
filename: './src/index.js',
11+
filename: './dist/aspnet-validation.js',
512
library: 'aspnetValidation',
613
libraryTarget: 'umd'
714
},
815
resolve: {
9-
// Add `.ts` and `.tsx` as a resolvable extension.
1016
extensions: ['.ts', '.tsx', '.js']
1117
},
1218
module: {
1319
rules: [
14-
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
15-
{ test: /\.tsx?$/, loader: 'ts-loader' }
20+
{
21+
test: /\.tsx?$/,
22+
loader: 'ts-loader',
23+
options: {
24+
compilerOptions: tsconfigOverride
25+
}
26+
},
1627
]
1728
},
1829
};

webpack.config.min.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
1+
const webpack = require('webpack');
2+
3+
let tsconfigOverride = {
4+
declaration: false,
5+
sourceMap: true,
6+
noEmit: false
7+
};
28

39
module.exports = {
410
entry: "./src/index.ts",
@@ -9,25 +15,22 @@ module.exports = {
915
},
1016
devtool: 'source-map',
1117
plugins: [
12-
new UglifyJSPlugin({
18+
new webpack.optimize.UglifyJsPlugin({
1319
sourceMap: true
1420
})
1521
],
1622
resolve: {
17-
// Add `.ts` and `.tsx` as a resolvable extension.
1823
extensions: ['.ts', '.tsx', '.js']
1924
},
2025
module: {
2126
rules: [
22-
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
23-
{ test: /\.tsx?$/, loader: 'ts-loader' },
24-
25-
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
2627
{
27-
enforce: "pre",
28-
test: /\.js$/,
29-
loader: "source-map-loader"
30-
}
28+
test: /\.tsx?$/,
29+
loader: 'ts-loader',
30+
options: {
31+
compilerOptions: tsconfigOverride
32+
}
33+
},
3134
]
3235
},
3336
};

0 commit comments

Comments
 (0)