Skip to content

Instantly share code, notes, and snippets.

@JasonGoemaat
Created August 14, 2016 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JasonGoemaat/d916745bea7b529bbda5c549c2fc5d70 to your computer and use it in GitHub Desktop.
Save JasonGoemaat/d916745bea7b529bbda5c549c2fc5d70 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
"app": ["./src/scripts", "./src/main.ts"]
},
output: { path: './dist', filename: 'app.bundle.js' },
module: {
loaders: [
{ test: /\.ts$/, loaders: ['awesome-typescript-loader', 'angular2-template-loader'] },
{ test: /\.html$/, loader: 'raw' },
{ test: /\.css$/, loader: 'raw', exclude: /node_modules/ }
]
},
resolve: { extensions: ['', '.js', '.ts', '.html', '.css', '.min.js', '.min.css'] },
plugins: [
new HtmlWebpackPlugin({ template: './src/index.html' }),
new webpack.DefinePlugin({ app: {
environment: JSON.stringify(process.env.APP_ENVIRONMENT || 'development')
}
}),
new CopyWebpackPlugin([ { from: 'public' }])
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment