Skip to content

Instantly share code, notes, and snippets.

@epaillous
Created June 28, 2017 14:23
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 epaillous/59d30096588d46d545feadfc29e2afb8 to your computer and use it in GitHub Desktop.
Save epaillous/59d30096588d46d545feadfc29e2afb8 to your computer and use it in GitHub Desktop.
var helpers = require('./helpers');
var webpack = require('webpack');
var credentials = require('./credentials/test.json');
module.exports = {
devtool: 'inline-source-map',
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
use: ['awesome-typescript-loader', 'angular2-template-loader']
},
{
test: /\.html$/,
use: 'html-loader'
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
use: 'null-loader'
},
{
test: /\.scss$/,
exclude: helpers.root('src', 'app'),
use: 'null-loader'
},
{
test: /\.scss$/,
include: helpers.root('src', 'app'),
use: [
{ loader: 'raw-loader'},
{ loader: 'resolve-url-loader'},
{ loader: 'sass-loader'}
]
}
]
},
plugins: [
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new webpack.EnvironmentPlugin(credentials)
],
}
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment