Skip to content

Commit

Permalink
Improved build setup
Browse files Browse the repository at this point in the history
  • Loading branch information
florisdh committed Jul 15, 2019
1 parent 91d3861 commit a07425e
Show file tree
Hide file tree
Showing 9 changed files with 4,572 additions and 158 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
src
node_modules
config
.gitignore
tsconfig.json
33 changes: 33 additions & 0 deletions config/webpack.build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const path = require('path');
const root = path.join(__dirname, '../');
const config = require(path.join(root, 'package.json'));
const {CleanWebpackPlugin} = require('clean-webpack-plugin');

module.exports = {
mode: 'production',
context: root, // to automatically find tsconfig.json
entry: path.join(root, 'src/index.ts'),
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
devtool: 'source-map',
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
},
plugins: [
new CleanWebpackPlugin()
],
output: {
filename: `index.min.js`,
path: path.join(root, 'build'),
libraryTarget: 'umd',
library: config.name,
umdNamedDefine: true
}
};
Loading

0 comments on commit a07425e

Please sign in to comment.