Skip to content

Commit

Permalink
Proper release layout and build settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kum-deepak committed Jun 28, 2018
1 parent 2c33153 commit 4b8c6a3
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore everything then include selectively
*

!bundles/**/*
!esm5/**/*
!esm6/**/*
!index.d.ts
!package.json
!README.md
Empty file added README.md
Empty file.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './esm5/';
58 changes: 58 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "@stomp/stompjs",
"version": "0.0.1",
"description": "STOMP cleint for Javascript and Typescript",
"main": "dist/index.js",
"scripts": {
"clean": "rm -rf _bundles lib lib-esm",
"build": "npm run clean && tsc && tsc -m es6 --outDir lib-esm && webpack && webpack --mode=production --output-filename=stomp.min.js",
"clean": "shx rm -rf bundles esm5 esm6",
"build-tsc": "tsc -m es6 --outDir esm6",
"build-webpack": "webpack && webpack --mode=production --output-filename=stomp.umd.min.js",
"build": "npm run clean && tsc && npm run build-tsc && npm run build-webpack",
"test": "qunit --timeout 10000 -c tests/config/node-config.js -t tests/unit/*"
},
"repository": {
Expand All @@ -29,9 +30,15 @@
"awesome-typescript-loader": "^5.2.0",
"jquery": "^3.3.1",
"qunit": "^1.0.0",
"shx": "^0.3.1",
"typescript": "^2.9.2",
"webpack": "^4.12.1",
"webpack-cli": "^3.0.8",
"websocket": "^1.0.26"
}
},
"esm5": "./esm5/index.js",
"esm6": "./esm6/index.js",
"main": "bundles/stomp.umd.js",
"typings": "index.d.ts",
"sideEffects": false
}
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "lib", /* Redirect output structure to the directory. */
"outDir": "esm5", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
"removeComments": false, /* Do not emit comments to output. */
Expand Down Expand Up @@ -55,5 +55,6 @@
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
}
},
"include": ["./src/**/*.ts"] /* Only compile files in src, avoids confusion with code in node_modules or compiled code */
}
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const webpack = require("webpack");

const PATHS = {
entryPoint: path.resolve(__dirname, 'src/index.ts'),
bundles: path.resolve(__dirname, '_bundles'),
bundles: path.resolve(__dirname, 'bundles'),
};

const config = {
Expand All @@ -20,7 +20,7 @@ const config = {
// it will be accessible at `window.MyLib`
output: {
path: PATHS.bundles,
filename: '[name].js',
filename: '[name].umd.js',
libraryTarget: 'umd',
library: 'StompJs',
umdNamedDefine: true
Expand Down

0 comments on commit 4b8c6a3

Please sign in to comment.