From e22d3c4ea920dcea789078b93e7bb70946896699 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:21:08 +0200 Subject: [PATCH 01/19] standard formatting, preparing for next changes --- webpack.config.js | 114 +++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index d88dde5..ccdeb17 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,66 +2,66 @@ var path = require("path"); var webpack = require("webpack"); var PATHS = { - entryPoint: path.resolve(__dirname, 'src/index.ts'), - bundles: path.resolve(__dirname, '_bundles'), + entryPoint: path.resolve(__dirname, 'src/index.ts'), + bundles: path.resolve(__dirname, '_bundles'), } var config = { - // These are the entry point of our library. We tell webpack to use - // the name we assign later, when creating the bundle. We also use - // the name to filter the second entry point for applying code - // minification via UglifyJS - entry: { - 'my-lib': [PATHS.entryPoint], - 'my-lib.min': [PATHS.entryPoint] - }, - // The output defines how and where we want the bundles. The special - // value `[name]` in `filename` tell Webpack to use the name we defined above. - // We target a UMD and name it MyLib. When including the bundle in the browser - // it will be accessible at `window.MyLib` - output: { - path: PATHS.bundles, - filename: '[name].js', - libraryTarget: 'umd', - library: 'MyLib', - umdNamedDefine: true - }, - // Add resolve for `tsx` and `ts` files, otherwise Webpack would - // only look for common JavaScript file extension (.js) - resolve: { - extensions: ['.ts', '.tsx', '.js'] - }, - // Activate source maps for the bundles in order to preserve the original - // source when the user debugs the application - devtool: 'source-map', - plugins: [ - // Apply minification only on the second bundle by - // using a RegEx on the name, which must end with `.min.js` - // NB: Remember to activate sourceMaps in UglifyJsPlugin - // since they are disabled by default! - new webpack.optimize.UglifyJsPlugin({ - minimize: true, - sourceMap: true, - include: /\.min\.js$/, - }) - ], - module: { - // Webpack doesn't understand TypeScript files and a loader is needed. - // `node_modules` folder is excluded in order to prevent problems with - // the library dependencies, as well as `__tests__` folders that - // contain the tests for the library - loaders: [{ - test: /\.tsx?$/, - loader: 'awesome-typescript-loader', - exclude: /node_modules/, - query: { - // we don't want any declaration file in the bundles - // folder since it wouldn't be of any use ans the source - // map already include everything for debugging - declaration: false, - } - }] - } + // These are the entry point of our library. We tell webpack to use + // the name we assign later, when creating the bundle. We also use + // the name to filter the second entry point for applying code + // minification via UglifyJS + entry: { + 'my-lib': [PATHS.entryPoint], + 'my-lib.min': [PATHS.entryPoint] + }, + // The output defines how and where we want the bundles. The special + // value `[name]` in `filename` tell Webpack to use the name we defined above. + // We target a UMD and name it MyLib. When including the bundle in the browser + // it will be accessible at `window.MyLib` + output: { + path: PATHS.bundles, + filename: '[name].js', + libraryTarget: 'umd', + library: 'MyLib', + umdNamedDefine: true + }, + // Add resolve for `tsx` and `ts` files, otherwise Webpack would + // only look for common JavaScript file extension (.js) + resolve: { + extensions: ['.ts', '.tsx', '.js'] + }, + // Activate source maps for the bundles in order to preserve the original + // source when the user debugs the application + devtool: 'source-map', + plugins: [ + // Apply minification only on the second bundle by + // using a RegEx on the name, which must end with `.min.js` + // NB: Remember to activate sourceMaps in UglifyJsPlugin + // since they are disabled by default! + new webpack.optimize.UglifyJsPlugin({ + minimize: true, + sourceMap: true, + include: /\.min\.js$/, + }) + ], + module: { + // Webpack doesn't understand TypeScript files and a loader is needed. + // `node_modules` folder is excluded in order to prevent problems with + // the library dependencies, as well as `__tests__` folders that + // contain the tests for the library + loaders: [{ + test: /\.tsx?$/, + loader: 'awesome-typescript-loader', + exclude: /node_modules/, + query: { + // we don't want any declaration file in the bundles + // folder since it wouldn't be of any use ans the source + // map already include everything for debugging + declaration: false, + } + }] + } } module.exports = config; \ No newline at end of file From 34b34f977752548a7976450d263d4fb55a83921c Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:25:12 +0200 Subject: [PATCH 02/19] compressed the comments to two lines to get a better sense of howlarge the build script really is. Cleaned up missing/trailing comma's etc. --- webpack.config.js | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index ccdeb17..6e2efd9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,22 +3,18 @@ var webpack = require("webpack"); var PATHS = { entryPoint: path.resolve(__dirname, 'src/index.ts'), - bundles: path.resolve(__dirname, '_bundles'), -} + bundles: path.resolve(__dirname, '_bundles') +}; var config = { - // These are the entry point of our library. We tell webpack to use - // the name we assign later, when creating the bundle. We also use - // the name to filter the second entry point for applying code - // minification via UglifyJS + // These are the entry point of our library. We tell webpack to use the name we assign later, when creating the bundle. + // We also use the name to filter the second entry point for applying code minification via UglifyJS entry: { 'my-lib': [PATHS.entryPoint], 'my-lib.min': [PATHS.entryPoint] }, - // The output defines how and where we want the bundles. The special - // value `[name]` in `filename` tell Webpack to use the name we defined above. - // We target a UMD and name it MyLib. When including the bundle in the browser - // it will be accessible at `window.MyLib` + // The output defines how and where we want the bundles. The special value `[name]` in `filename` tell Webpack to use the name we defined above. + // We target a UMD and name it MyLib. When including the bundle in the browser it will be accessible at `window.MyLib` output: { path: PATHS.bundles, filename: '[name].js', @@ -35,10 +31,8 @@ var config = { // source when the user debugs the application devtool: 'source-map', plugins: [ - // Apply minification only on the second bundle by - // using a RegEx on the name, which must end with `.min.js` - // NB: Remember to activate sourceMaps in UglifyJsPlugin - // since they are disabled by default! + // Apply minification only on the second bundle by using a RegEx on the name, which must end with `.min.js` + // NB: Remember to activate sourceMaps in UglifyJsPlugin since they are disabled by default! new webpack.optimize.UglifyJsPlugin({ minimize: true, sourceMap: true, @@ -46,22 +40,19 @@ var config = { }) ], module: { - // Webpack doesn't understand TypeScript files and a loader is needed. - // `node_modules` folder is excluded in order to prevent problems with - // the library dependencies, as well as `__tests__` folders that - // contain the tests for the library + // Webpack doesn't understand TypeScript files and a loader is needed. `node_modules` folder is excluded in order to prevent problems with + // the library dependencies, as well as `__tests__` folders that contain the tests for the library loaders: [{ test: /\.tsx?$/, loader: 'awesome-typescript-loader', exclude: /node_modules/, query: { - // we don't want any declaration file in the bundles - // folder since it wouldn't be of any use ans the source + // we don't want any declaration file in the bundles folder since it wouldn't be of any use ans the source // map already include everything for debugging declaration: false, } }] } -} +}; module.exports = config; \ No newline at end of file From fc25f637a47654663c453095720f27cbb41efcff Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:30:43 +0200 Subject: [PATCH 03/19] updated to Webpack 2.4.1 --- package.json | 2 +- webpack.config.js | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 138a4e3..bc3cc90 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,6 @@ "awesome-typescript-loader": "^3.0.4-rc.2", "shx": "^0.2.2", "typescript": "^2.1.6", - "webpack": "^2.2.1" + "webpack": "2.4.1" } } diff --git a/webpack.config.js b/webpack.config.js index 6e2efd9..f27884c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,19 +39,18 @@ var config = { include: /\.min\.js$/, }) ], + + + // Webpack doesn't understand TypeScript files and a loader is needed. module: { - // Webpack doesn't understand TypeScript files and a loader is needed. `node_modules` folder is excluded in order to prevent problems with - // the library dependencies, as well as `__tests__` folders that contain the tests for the library - loaders: [{ - test: /\.tsx?$/, - loader: 'awesome-typescript-loader', - exclude: /node_modules/, - query: { - // we don't want any declaration file in the bundles folder since it wouldn't be of any use ans the source - // map already include everything for debugging - declaration: false, + rules: [ + { + test: /\.ts$/, + use: [ + {loader: 'awesome-typescript-loader'} + ] } - }] + ] } }; From ab2986a2dadcecfb2ca26d589f6b3c6f93be822f Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:34:47 +0200 Subject: [PATCH 04/19] 'minimize' should be 'compress'. Removed trailing comma. --- webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index f27884c..0e1ddfa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -34,9 +34,9 @@ var config = { // Apply minification only on the second bundle by using a RegEx on the name, which must end with `.min.js` // NB: Remember to activate sourceMaps in UglifyJsPlugin since they are disabled by default! new webpack.optimize.UglifyJsPlugin({ - minimize: true, + compress:true, sourceMap: true, - include: /\.min\.js$/, + include: /\.min\.js$/ }) ], From f3d5356d0a41000498d4a993cc7bde072e6f10d9 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:37:06 +0200 Subject: [PATCH 05/19] updated to TypeScript 2.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc3cc90..1300e90 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": { "awesome-typescript-loader": "^3.0.4-rc.2", "shx": "^0.2.2", - "typescript": "^2.1.6", + "typescript": "2.3.1", "webpack": "2.4.1" } } From 1f2ae707b814f2690eb433491e24df1d1db457e8 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:38:21 +0200 Subject: [PATCH 06/19] Dependencies are devDependencies! They are not needed by library users (used for building the distribution) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1300e90..c5519ba 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "clean": "shx rm -rf _bundles lib lib-esm", "build": "npm run clean && tsc && tsc -m es6 --outDir lib-esm && webpack" }, - "dependencies": { + "devDependencies": { "awesome-typescript-loader": "^3.0.4-rc.2", "shx": "^0.2.2", "typescript": "2.3.1", From e7b0ac77ed7d167c66466d524333db99537fd6e2 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:40:21 +0200 Subject: [PATCH 07/19] updated index.ts to actually reflect how a library would be exported (it wouldn't use it's own library, but it would export everything in a 'barrel' index, so all types can be required from one import) --- src/index.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index a9f0dcc..f1c9796 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1 @@ -import {Greeter} from './Greeter'; - -const example = new Greeter('World'); - -console.log(example.greet()); \ No newline at end of file +export * from './Greeter'; \ No newline at end of file From c4e4c66e4616d72e361b7a0334336f6ca2412681 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:51:38 +0200 Subject: [PATCH 08/19] As an example, I've added momentjs as *optional* 3rd party dependency, which is configured to be excluded from the distribution, so users are free to omit it or choose their own version. It doesn't affect the dist size at all. --- package.json | 3 +++ src/Greeter.ts | 7 +++++++ webpack.config.js | 10 ++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c5519ba..3ac24e1 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,9 @@ "clean": "shx rm -rf _bundles lib lib-esm", "build": "npm run clean && tsc && tsc -m es6 --outDir lib-esm && webpack" }, + "dependencies": { + "moment": "^2.18.1" + }, "devDependencies": { "awesome-typescript-loader": "^3.0.4-rc.2", "shx": "^0.2.2", diff --git a/src/Greeter.ts b/src/Greeter.ts index 716d3f8..7afa047 100644 --- a/src/Greeter.ts +++ b/src/Greeter.ts @@ -1,6 +1,13 @@ +import * as moment from 'moment'; + export class Greeter { constructor(public greeting: string) { } greet() { + if (typeof moment !== 'undefined') { + console.log('it is now: ', moment().format()); + } else { + console.log('it is now: ', new Date().toString()); + } return `Hello, ${this.greeting}!`; } } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 0e1ddfa..015ba06 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -40,7 +40,6 @@ var config = { }) ], - // Webpack doesn't understand TypeScript files and a loader is needed. module: { rules: [ @@ -51,7 +50,14 @@ var config = { ] } ] - } + }, + + // this library should not include external dependencies, so our library uses + // can choose their own version (or omit it completely if it is optional) + externals: { + // tell Webpack to be compatible with the following format for requiring moment + 'moment': {root: 'moment', commonjs: 'moment', commonjs2: 'moment', amd: 'moment'} + }, }; module.exports = config; \ No newline at end of file From b1dc6718a321e1daa3548c3e97654170e36b945a Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:54:41 +0200 Subject: [PATCH 09/19] simplified build (paths) and removed unnecessary absolute path resolver --- webpack.config.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 015ba06..b9bb887 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,22 +1,17 @@ var path = require("path"); var webpack = require("webpack"); -var PATHS = { - entryPoint: path.resolve(__dirname, 'src/index.ts'), - bundles: path.resolve(__dirname, '_bundles') -}; - var config = { // These are the entry point of our library. We tell webpack to use the name we assign later, when creating the bundle. // We also use the name to filter the second entry point for applying code minification via UglifyJS entry: { - 'my-lib': [PATHS.entryPoint], - 'my-lib.min': [PATHS.entryPoint] + 'my-lib': ['./src/index.ts'], + 'my-lib.min': ['./src/index.ts'] }, // The output defines how and where we want the bundles. The special value `[name]` in `filename` tell Webpack to use the name we defined above. // We target a UMD and name it MyLib. When including the bundle in the browser it will be accessible at `window.MyLib` output: { - path: PATHS.bundles, + path: path.resolve(__dirname, '_bundles'), filename: '[name].js', libraryTarget: 'umd', library: 'MyLib', From b62f5556d09a33d2c8ba39b3ad3496b1af2d2a04 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:55:07 +0200 Subject: [PATCH 10/19] removed trailing comma --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index b9bb887..3be7fe1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -52,7 +52,7 @@ var config = { externals: { // tell Webpack to be compatible with the following format for requiring moment 'moment': {root: 'moment', commonjs: 'moment', commonjs2: 'moment', amd: 'moment'} - }, + } }; module.exports = config; \ No newline at end of file From 3fbf5733be96e6b787815ea3e63c7811d013f750 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 06:59:52 +0200 Subject: [PATCH 11/19] made naming consistent and cleared to library users --- .gitignore | 6 +++--- package.json | 4 ++-- tsconfig.json | 2 +- webpack.config.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index ebd315f..f495bb2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ .DS_Store node_modules -lib -lib-esm -_bundles \ No newline at end of file +dist-commonjs +dist-esmodule +dist-umd \ No newline at end of file diff --git a/package.json b/package.json index 3ac24e1..13f5e25 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "author": "Marco Botto", "license": "MIT", "scripts": { - "clean": "shx rm -rf _bundles lib lib-esm", - "build": "npm run clean && tsc && tsc -m es6 --outDir lib-esm && webpack" + "clean": "shx rm -rf dist-umd dist-commonjs disy-esmodule", + "build": "npm run clean && tsc && tsc -m es6 --outDir dist-esmodule && webpack" }, "dependencies": { "moment": "^2.18.1" diff --git a/tsconfig.json b/tsconfig.json index cbc11ff..e27b32e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "module": "commonjs", "target": "es5", "lib": [ "es2015", "dom" ], - "outDir": "lib", + "outDir": "dist-commonjs", "allowSyntheticDefaultImports": true, "suppressImplicitAnyIndexErrors": true, "forceConsistentCasingInFileNames": true, diff --git a/webpack.config.js b/webpack.config.js index 3be7fe1..054eeb3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,7 @@ var config = { // The output defines how and where we want the bundles. The special value `[name]` in `filename` tell Webpack to use the name we defined above. // We target a UMD and name it MyLib. When including the bundle in the browser it will be accessible at `window.MyLib` output: { - path: path.resolve(__dirname, '_bundles'), + path: path.resolve(__dirname, 'dist-umd'), filename: '[name].js', libraryTarget: 'umd', library: 'MyLib', From 87e2322cff71f215f52393fe741623aed719a80c Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 07:00:39 +0200 Subject: [PATCH 12/19] index.js doesn't exist in the root, point to commonjs index.js as default instead --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13f5e25..596447f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript-lib-example", "version": "1.0.0", "description": "Example of TypeScript library setup for multiple compilation targets using tsc and webpack", - "main": "index.js", + "main": "dist-commonjs/index.js", "repository": "https://www.github.com/elboman/typescript-lib-example", "author": "Marco Botto", "license": "MIT", From 313208ca8a5c0a9c081b656d68d2fc3cd9008f25 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 07:03:42 +0200 Subject: [PATCH 13/19] added MIT license file under your name (in package json it says it's MIT, you committed it this year) --- LICENSE | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..80b667c --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 Marco Botto +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file From 58ac77d22dccfb498bc758fb8387bef98ec88d6f Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 07:04:46 +0200 Subject: [PATCH 14/19] Added TypeScript support for meta data (to support annotations). Some libraries need this, for example when working with Angular2+ --- tsconfig.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index e27b32e..3d24e29 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,8 @@ "allowSyntheticDefaultImports": true, "suppressImplicitAnyIndexErrors": true, "forceConsistentCasingInFileNames": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, "sourceMap": true, "declaration": true, "jsx": "react" From e3b4ad4fbf537be1a9f4c79ddf28e5d4734f6f4a Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 07:08:11 +0200 Subject: [PATCH 15/19] update package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 596447f..5aac410 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typescript-lib-example", - "version": "1.0.0", + "version": "1.1.0", "description": "Example of TypeScript library setup for multiple compilation targets using tsc and webpack", "main": "dist-commonjs/index.js", "repository": "https://www.github.com/elboman/typescript-lib-example", From dbc12fdb123a864cb39adc6d9a895d6a6e4d5d02 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 07:11:22 +0200 Subject: [PATCH 16/19] updated, author, contributor and git repo entries --- package.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5aac410..9f5ec45 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,20 @@ "version": "1.1.0", "description": "Example of TypeScript library setup for multiple compilation targets using tsc and webpack", "main": "dist-commonjs/index.js", - "repository": "https://www.github.com/elboman/typescript-lib-example", - "author": "Marco Botto", + "repository": { + "type": "git", + "url": "https://www.github.com/elboman/typescript-lib-example.git" + }, + "author": { + "name": "Marco Botto", + "email": "b.bottema@projectnibble.org", + "url": "http://marcobotto.com" + }, + "contributors": [{ + "name": "Benny Bottema", + "email": "benny@bennybottema.com", + "url": "http://www.bennybottema.com" + }], "license": "MIT", "scripts": { "clean": "shx rm -rf dist-umd dist-commonjs disy-esmodule", From a0d2dded1807e7df98c23e410fec2064a0acd629 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 07:28:04 +0200 Subject: [PATCH 17/19] type --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 054eeb3..09a2f71 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -47,7 +47,7 @@ var config = { ] }, - // this library should not include external dependencies, so our library uses + // this library should not include external dependencies, so our library users // can choose their own version (or omit it completely if it is optional) externals: { // tell Webpack to be compatible with the following format for requiring moment From 6b1405292b5fc0eb5ed86228716abd2302e2e9e9 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 3 Jun 2017 07:34:49 +0200 Subject: [PATCH 18/19] added link to the blog explaining this repo setup --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e69de29..9df05b1 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +Read about this setup at: [Compiling and bundling TypeScript libraries with Webpack](http://marcobotto.com/compiling-and-bundling-typescript-libraries-with-webpack/). \ No newline at end of file From 77a2b72727f5614127c2a31111bd43d44cad2ed7 Mon Sep 17 00:00:00 2001 From: bbottema Date: Sat, 19 Oct 2019 10:57:27 +0200 Subject: [PATCH 19/19] typo: disy-esmodule -> dist-esmodule --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f5ec45..9833852 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }], "license": "MIT", "scripts": { - "clean": "shx rm -rf dist-umd dist-commonjs disy-esmodule", + "clean": "shx rm -rf dist-umd dist-commonjs dist-esmodule", "build": "npm run clean && tsc && tsc -m es6 --outDir dist-esmodule && webpack" }, "dependencies": {