Created
December 14, 2017 01:47
-
-
Save KonTrax/c178c4607a691a94739e8d9b0e7d590d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const n_path = require('path') | |
//============================================================================== | |
const CONFIG = { | |
root: { | |
src: n_path.resolve('./src'), | |
dist: n_path.resolve('./dist'), | |
}, | |
index: 'index.ts', | |
} | |
//============================================================================== | |
module.exports = {//============================================================ | |
entry: n_path.join(CONFIG.root.src, CONFIG.index), | |
output: { | |
filename: 'bundle.js', | |
path: CONFIG.root.dist, | |
}, | |
// Enable sourcemaps for debugging webpack's output. | |
devtool: 'source-map', | |
resolve: { | |
// Add '.ts' and '.tsx' as resolvable extensions. | |
extensions: [ | |
'.ts', | |
'.tsx', | |
'.js', | |
'.json', | |
], | |
}, | |
module: { | |
rules: [ | |
{// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. | |
test: /\.tsx?$/, | |
exclude: /(node_modules)/, | |
loader: 'awesome-typescript-loader', | |
}, | |
{// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. | |
enforce: 'pre', | |
test: /\.js$/, | |
loader: 'source-map-loader' | |
}, | |
], | |
}, | |
}//============================================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment