mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-03-07 00:09:13 +05:30
#242: enabel babel caching
This commit is contained in:
parent
1e593019be
commit
ccd6b96ac6
5
.babelrc
5
.babelrc
@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"presets": ["react", "es2015", "stage-0"],
|
"presets": ["react", "es2015", "stage-0"],
|
||||||
"plugins": ["transform-runtime", ["react-intl", {"messagesDir": "./dist/messages/"}]],
|
"plugins": [
|
||||||
|
["transform-runtime", {"polyfill": false}],
|
||||||
|
["react-intl", {"messagesDir": "./dist/messages/"}]
|
||||||
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"development": {
|
"development": {
|
||||||
"presets": ["react-hmre"]
|
"presets": ["react-hmre"]
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'babel-polyfill';
|
import 'babel-polyfill';
|
||||||
|
import 'whatwg-fetch';
|
||||||
import 'promise.prototype.finally';
|
import 'promise.prototype.finally';
|
||||||
|
|
||||||
// allow :active styles in mobile Safary
|
// allow :active styles in mobile Safary
|
||||||
|
@ -13,6 +13,7 @@ const cssImport = require('postcss-import');
|
|||||||
const vendor = Object.keys(require('./package.json').dependencies);
|
const vendor = Object.keys(require('./package.json').dependencies);
|
||||||
|
|
||||||
const rootPath = path.resolve('./src');
|
const rootPath = path.resolve('./src');
|
||||||
|
const outputPath = path.join(__dirname, 'dist');
|
||||||
|
|
||||||
var config = {};
|
var config = {};
|
||||||
try {
|
try {
|
||||||
@ -73,14 +74,16 @@ const cssLoaderQuery = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var webpackConfig = {
|
const webpackConfig = {
|
||||||
|
cache: true,
|
||||||
|
|
||||||
entry: {
|
entry: {
|
||||||
app: path.join(__dirname, 'src'),
|
app: path.join(__dirname, 'src'),
|
||||||
vendor: vendor
|
vendor: vendor
|
||||||
},
|
},
|
||||||
|
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, 'dist'),
|
path: outputPath,
|
||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
filename: '[name].js?[hash]'
|
filename: '[name].js?[hash]'
|
||||||
},
|
},
|
||||||
@ -120,10 +123,6 @@ var webpackConfig = {
|
|||||||
collapseWhitespace: isProduction
|
collapseWhitespace: isProduction
|
||||||
},
|
},
|
||||||
ga: config.ga
|
ga: config.ga
|
||||||
}),
|
|
||||||
new webpack.ProvidePlugin({
|
|
||||||
// window.fetch polyfill
|
|
||||||
fetch: 'imports?this=>self!exports?self.fetch!whatwg-fetch'
|
|
||||||
})
|
})
|
||||||
].concat(isTest ? [] : [
|
].concat(isTest ? [] : [
|
||||||
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js?[hash]')
|
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js?[hash]')
|
||||||
@ -142,7 +141,7 @@ var webpackConfig = {
|
|||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: 'babel'
|
loader: 'babel?cacheDirectory=true'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(png|gif|jpg|svg)$/,
|
test: /\.(png|gif|jpg|svg)$/,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user