Experimental webpack support

This commit is contained in:
Dolan
2017-12-22 16:49:25 +00:00
parent c469fb24db
commit 90dc1103f6
2 changed files with 35 additions and 1 deletions

View File

@ -9,6 +9,7 @@
"prepublishOnly": "npm run build",
"lint": "tslint --project ./src",
"build": "rimraf ./build && tsc -p src",
"webpack": "rimraf ./build && webpack",
"demo": "npm run build && node ./demo",
"typedoc": "typedoc --out docs/ src/ --module commonjs --target ES6 --disableOutputCheck"
},
@ -53,6 +54,7 @@
"devDependencies": {
"@types/chai": "^3.4.35",
"@types/mocha": "^2.2.39",
"awesome-typescript-loader": "^3.4.1",
"chai": "^3.5.0",
"mocha": "^3.2.0",
"prompt": "^1.0.0",
@ -60,6 +62,7 @@
"shelljs": "^0.7.7",
"tslint": "^5.1.0",
"typedoc": "^0.5.10",
"typescript": "2.4.1"
"typescript": "2.4.1",
"webpack": "^3.10.0"
}
}

31
webpack.config.js Normal file
View File

@ -0,0 +1,31 @@
const path = require('path');
const { TsConfigPathsPlugin } = require('awesome-typescript-loader');
module.exports = {
entry: './src/index.ts',
output: {
path: path.resolve('build'),
filename: 'bundle.js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
plugins: [
new TsConfigPathsPlugin(/* { configFileName, compiler } */)
]
},
// Source maps support ('inline-source-map' also works)
devtool: 'source-map',
module: {
rules: [
{
test: /\.ts|\.tsx$/,
loader: 'awesome-typescript-loader',
exclude: [/^(?!.*\.spec\.ts$).*\.ts$/]
}
]
},
};