include webpack babel file in server for possible isomorphic stuff in the future
This commit is contained in:
parent
257ee24b90
commit
dceff0d4cf
2 changed files with 13 additions and 3 deletions
14
index.js
14
index.js
|
@ -1,11 +1,21 @@
|
|||
let parsed = require('dotenv').config();
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
process.env.webpackAssets = JSON.stringify(require('./dist/static/manifest.json'));
|
||||
process.env.webpackChunkAssets = JSON.stringify(require('./dist/static/chunk-manifest.json'));
|
||||
require('./dist/server.bundle.js');
|
||||
} else {
|
||||
require('babel-register');
|
||||
require('babel-register')({
|
||||
"plugins": [
|
||||
[
|
||||
"babel-plugin-webpack-loaders",
|
||||
{
|
||||
"config": "./webpack.config.babel.js",
|
||||
"verbose": false
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
require('babel-polyfill');
|
||||
let parsed = require('dotenv').config();
|
||||
//// in development, let .env values override those in the environment already (i.e. in docker-compose.yml)
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
for (let key in parsed) {
|
||||
|
|
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
})
|
||||
},
|
||||
{
|
||||
test: /\.jpe?g$|\.gif$|\.png$|\.svg$/i,
|
||||
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.mp3$|\.eot$|\.ttf$|\.woff$|\.woff2$/i,
|
||||
loader: 'url-loader?limit=10000',
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue