-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pek-headless-tests
- Loading branch information
Showing
11 changed files
with
3,387 additions
and
1,669 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 |
---|---|---|
@@ -1 +1 @@ | ||
6.11.5 | ||
12.13.0 |
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
module.exports = function(api) { | ||
// eslint-disable-next-line no-process-env | ||
api.cache(() => process.env.NODE_ENV); | ||
|
||
const presets = [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
modules: false | ||
} | ||
], | ||
'@babel/preset-react' | ||
]; | ||
|
||
const plugins = [ | ||
'@babel/plugin-syntax-dynamic-import', | ||
'@babel/plugin-syntax-import-meta', | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-proposal-json-strings', | ||
[ | ||
'@babel/plugin-proposal-decorators', | ||
{ | ||
legacy: true | ||
} | ||
], | ||
'@babel/plugin-proposal-function-sent', | ||
'@babel/plugin-proposal-export-namespace-from', | ||
'@babel/plugin-proposal-numeric-separator', | ||
'@babel/plugin-proposal-throw-expressions', | ||
'@babel/plugin-proposal-export-default-from', | ||
'@babel/plugin-proposal-logical-assignment-operators', | ||
'@babel/plugin-proposal-optional-chaining', | ||
[ | ||
'@babel/plugin-proposal-pipeline-operator', | ||
{ | ||
proposal: 'minimal' | ||
} | ||
], | ||
'@babel/plugin-proposal-nullish-coalescing-operator', | ||
'@babel/plugin-proposal-do-expressions', | ||
'@babel/plugin-proposal-function-bind' | ||
]; | ||
|
||
return { | ||
presets, | ||
plugins, | ||
env: { | ||
development: { | ||
plugins: ['react-hot-loader/babel'] | ||
}, | ||
test: { | ||
presets: [ | ||
'@babel/preset-env', | ||
['@babel/preset-react', { development: true }] | ||
] | ||
} | ||
} | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,14 +1,125 @@ | ||
const _ = require('lodash'); | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const { compact } = require('lodash'); | ||
|
||
const baseConfigs = require( | ||
'@department-of-veterans-affairs/caseflow-frontend-toolkit/config/getWebpackConfig' | ||
)(__dirname, './src/index'); | ||
const devBuild = process.env.NODE_ENV !== 'production'; // eslint-disable-line no-process-env | ||
|
||
module.exports = _.merge(baseConfigs, { | ||
const config = { | ||
mode: devBuild ? 'development' : 'production', | ||
entry: ['./src/index'], | ||
output: { | ||
path: path.resolve(__dirname, '..', 'app', 'assets', 'javascripts'), | ||
sourceMapFilename: 'sourcemap-[file].map', | ||
path: path.join(__dirname, '../app/assets/javascripts'), | ||
filename: 'react-app.js', | ||
library: 'efolderExpress' | ||
library: 'efolderExpress', | ||
libraryExport: 'default', | ||
libraryTarget: 'umd' | ||
}, | ||
plugins: compact([ | ||
new webpack.EnvironmentPlugin({ NODE_ENV: 'development' }) | ||
]), | ||
resolve: { | ||
extensions: ['.js', '.jsx'], | ||
alias: { | ||
// This does not actually appear to be necessary, but it does silence | ||
// a warning from superagent-no-cache. | ||
ie: 'component-ie' | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: new RegExp( | ||
'node_modules/(?!@department-of-veterans-affairs/caseflow-frontend-toolkit)' | ||
), | ||
use: [ | ||
{ | ||
loader: 'babel-loader' | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.(ttf|eot|woff|woff2)$/, | ||
use: { | ||
loader: | ||
'url-loader?limit=1024&name=fonts/[name]-[hash].[ext]&outputPath=../../../public/&publicPath=/' | ||
} | ||
}, | ||
{ | ||
test: /\.module\.s(a|c)ss$/, | ||
use: [ | ||
{ | ||
loader: 'style-loader' | ||
}, | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
modules: true, | ||
sourceMap: true | ||
} | ||
}, | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sourceMap: true | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.scss?$/, | ||
exclude: /\.module.(s(a|c)ss)$/, | ||
use: [ | ||
{ | ||
loader: 'style-loader' | ||
}, | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
sourceMap: true | ||
} | ||
}, | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sourceMap: true | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.css?$/, | ||
use: [ | ||
{ | ||
loader: 'style-loader' | ||
}, | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
sourceMap: true, | ||
url: false | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
test: /\.(png|svg|jpg|gif)$/, | ||
use: [ | ||
'url-loader?limit=1024&name=images/[name]-[hash].[ext]&outputPath=../../../public/&publicPath=/' | ||
] | ||
} | ||
] | ||
} | ||
}); | ||
}; | ||
|
||
if (devBuild) { | ||
console.log('Webpack dev build for Rails'); // eslint-disable-line no-console | ||
config.devtool = 'eval-source-map'; | ||
} else { | ||
console.log('Webpack production build for Rails'); // eslint-disable-line no-console | ||
console.log('Generating source maps...'); // eslint-disable-line no-console | ||
config.devtool = 'source-map'; | ||
} | ||
|
||
module.exports = config; |
Oops, something went wrong.