Last active
December 12, 2017 23:32
-
-
Save anthanh/c6d7ded4cdf76951c582b0f971ff7ed9 to your computer and use it in GitHub Desktop.
Angular 5 with Universal and TransferState: Webpack config
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
// webpack.config.ts | |
const path = require('path'); | |
var nodeExternals = require('webpack-node-externals'); | |
module.exports = { | |
entry: { | |
server: './src/server.ts' | |
}, | |
resolve: { | |
extensions: ['.ts', '.js'], | |
alias: { | |
'main.server': path.join(__dirname, 'dist', 'server', 'main.bundle.js') | |
} | |
}, | |
target: 'node', | |
externals: [nodeExternals()], | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: '[name].js' | |
}, | |
module: { | |
rules: [ | |
{ test: /\.ts$/, loader: 'ts-loader' } | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment