-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix in authservice and webpack setup
- Loading branch information
1 parent
6fd64af
commit 49b86f4
Showing
6 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**/node_modules/* | ||
**/vendor/* | ||
**/*.min.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,5 +64,8 @@ Session.vim | |
# auto-generated tag files | ||
tags | ||
|
||
#dotenv | ||
# dotenv | ||
.env | ||
|
||
# build files | ||
build/ |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'use strict'; | ||
|
||
require('dotenv').load(); | ||
|
||
const webpack = require('webpack'); | ||
const HTMLPlugin = require('html-webpack-plugin'); | ||
const CleanPlugin = require('clean-webpack-plugin'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
const production = process.env.NODE_ENV === 'prodution'; | ||
|
||
let plugins = [ | ||
new ExtractTextPlugin({filename: 'bundle.css'}), | ||
new HTMLPlugin({template: `${__dirname}/app/index.html`}), | ||
new webpack.DefinePlugin({ | ||
__API_URL__: JSON.stringify(process.env.API_URL), | ||
__DEBUG__: JSON.stringify(!production), | ||
}), | ||
]; | ||
|
||
if(production){ | ||
plugins = plugins.concat([ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
mangle: true, | ||
compress: {warnings: false}, | ||
}), | ||
new CleanPlugin(), | ||
]); | ||
} | ||
|
||
module.exports = { | ||
entry: `${__dirname}/app/entry.js`, | ||
devtool: production ? false : 'source-map', | ||
output: { | ||
filename: 'bundle.js', | ||
path: `${__dirname}/build`, | ||
}, | ||
plugins, | ||
module: { | ||
loaders: [ | ||
{ | ||
test:/\.js$/, | ||
exclude: /node-modules/, | ||
use: ['babel-loader'], | ||
}, | ||
{ | ||
test: /\.html$/, | ||
use: ['html-loader'], | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
use: ExtractTextPlugin.extract({ | ||
use: [ | ||
{ | ||
loader: 'css-loader', | ||
options: {sourceMap:true}, | ||
}, | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sourceMap: true, | ||
includePaths: [`${__dirname}/app/scss`], | ||
}, | ||
}, | ||
], | ||
}), | ||
}, | ||
{ | ||
test: /\.(woff|ttf|svg|eot).*/, | ||
use: 'url-loader?limit=10000&name=image/[hash].[ext]', | ||
}, | ||
], | ||
}, | ||
}; |