Skip to content

Instantly share code, notes, and snippets.

@kkaabbaa kkaabbaa/webpack.config.js Secret
Created Jun 30, 2017

Embed
What would you like to do?
help plz - config for angular universal
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: {
server: './src/server.ts'
},
resolve: {
extensions: ['.ts', '.js']
},
target: 'node',
externals: [nodeExternals({
whitelist: [
/^ngx-bootstrap/,
/^@angular\/material/,
/^@ngx-translate\/core/,
/^@agm\/core/,
]
})],
node: {
__dirname: true
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [
{
test: /\.js$/,
use: [{
loader: 'babel-loader',
options: { presets: ['es2015'] },
}],
},
{
test: /\.ts$/,
loader: 'ts-loader'
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.