This file contains hidden or 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
const { resolve } = require('path'); | |
module.exports = { | |
context: resolve(__dirname, '../'), | |
entry: ['babel-polyfill', './app/js/main.js'], | |
resolve: { | |
extensions: [ | |
'*', '.js', '.jsx', | |
], | |
modules: [ |
This file contains hidden or 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
const { join } = require('path'); | |
const merge = require('webpack-merge'); | |
module.exports = merge(require('./webpack.base.config'), { | |
devtool: 'cheap-module-source-map', | |
module: { | |
rules: [ | |
... | |
], | |
}, |
This file contains hidden or 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
"scripts": { | |
"development": "webpack-dev-server --config ./webpack/webpack.development.config.js", | |
"production": "webpack --config ./webpack/webpack.production.config.js", | |
"test": "jest --config ./jest.config.json" | |
} |
This file contains hidden or 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
"scripts": { | |
"development": "cross-env NODE_ENV=development webpack-dev-server --config ./webpack/webpack.development.config.js", | |
"production": "cross-env NODE_ENV=production webpack --config ./webpack/webpack.production.config.js", | |
"test": "cross-env NODE_ENV=test jest --config ./jest.config.json" | |
} |
This file contains hidden or 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
const { resolve } = require('path'); | |
module.exports = { | |
context: resolve(__dirname, '../'), | |
entry: ['babel-polyfill', './app/js/main.js'], | |
resolve: { | |
extensions: [ | |
'*', '.js', '.jsx', | |
], | |
modules: [ |
This file contains hidden or 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
if (process.env.NODE_ENV === 'production') { | |
module.exports = require('./webpack.production.config'); | |
} else { | |
module.exports = require('./webpack.development.config'); | |
} |
This file contains hidden or 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
"scripts": { | |
"development": "cross-env NODE_ENV=development webpack-dev-server --config ./webpack", | |
"production": "cross-env NODE_ENV=production webpack --config ./webpack", | |
"test": "cross-env NODE_ENV=test jest --config ./jest.config.json" | |
} |
This file contains hidden or 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
API_URL=https://example.com/api/ |
This file contains hidden or 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
import axios from 'axios'; | |
const request = axios.create({ | |
baseURL: process.env.API_URL | |
}); | |
export default request; |
This file contains hidden or 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
"scripts": { | |
"development": "cross-env NODE_ENV=development env-cmd .env webpack-dev-server --config ./webpack", | |
"production": "cross-env NODE_ENV=production env-cmd .env webpack --config ./webpack", | |
"test": "cross-env NODE_ENV=test env-cmd .env jest --config ./jest.config.json" | |
} |