Skip to content

Instantly share code, notes, and snippets.

@fredv
Created March 3, 2017 09:53
Show Gist options
  • Save fredv/d5896bbca9c5fb5c4926a47f6cdb43af to your computer and use it in GitHub Desktop.
Save fredv/d5896bbca9c5fb5c4926a47f6cdb43af to your computer and use it in GitHub Desktop.
var webpack = require('webpack')
var PROD = (process.env.NODE_ENV === 'production')
module.exports = {
entry: ["./src/phrase.ts", "./src/directives/phrase_javascript.ts"],
output: {
filename: PROD ? "angular-phrase.min.js" : "angular-phrase.js",
path: __dirname + "/dist"
},
devtool: 'source-map',
resolve: {
extensions: [".webpack.js", ".web.js", ".ts", ".tsx"]
},
module: {
loaders: [
{ test: /\.tsx?$/, loader: "awesome-typescript-loader", exclude: /node_modules/ },
]
},
plugins: PROD ? [
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
})
] : []
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment