* fix: req.csrfToken doesn't always exist (e.g. 500 page) * feat: update dockerfile and add nextjs to build * fix: run linter * move @babel deps -> dev deps * move webpack looking things from deps -> dev deps * move pa11y-ci to optional dep * explicitly include optional deps for pa11y * allow heroku dev deps to be installed * fix: update postcss module * fix: update dockerfile build * tmp: disable renderReact * see if another deploy is slower/faster * move a few more packages to devDeps * upgrade to package-lock v2 * use dayjs instead of date-fns * move cross-env to devDeps * remove unused 'del' package * commit husky precommit hooks * add hrtime to clone-for-build.js * Revert "add hrtime to clone-for-build.js" This reverts commit 70ee647bacce833f4ed2f621f62c63c1d85e5413. * update babel/eslint * fix: remove unused plugin * try a .slugignore * fix: heroku-postbuild to use npm run build * fix: i cannot spell dereferenced * add .next/cache to heroku cacheDirectories * test cached build * remove aws-sdk, see what breaks * move jest-puppeteer to optional deps * fix: update browser-test.yml to use newer node version * move jimp to optional dependencies * move puppeteer to optional dependencies * fix: ci optional include * fix: bad copy pasta * remove previous react experiment * update tests/README.md with note about optional deps * bump node test version back to 14 * convert package-lock back to v1 * fix: use node 15.x to leverage npm optional deps * fix: optional dep install * test: see what happens with heroku/nodejs-typescript buildpack * back to heroku/nodejs buildpack * move jest to optional * revert jest move * remove .slugignore * cleanup dockerfile, move xlsx-population to optional, add comment about optional deps * Update Dockerfile Co-authored-by: James M. Greene <JamesMGreene@github.com> Co-authored-by: James M. Greene <JamesMGreene@github.com>
88 lines
2.2 KiB
JavaScript
88 lines
2.2 KiB
JavaScript
const path = require('path')
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
const { EnvironmentPlugin, ProvidePlugin } = require('webpack')
|
|
|
|
module.exports = {
|
|
mode: 'development',
|
|
devtool: process.env.NODE_ENV === 'development' ? 'eval' : 'source-map', // no 'eval' outside of development
|
|
entry: './javascripts/index.js',
|
|
output: {
|
|
filename: 'index.js',
|
|
path: path.resolve(__dirname, 'dist'),
|
|
publicPath: '/dist'
|
|
},
|
|
stats: 'errors-only',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.m?js$/,
|
|
exclude: /(node_modules)/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
exclude: /node_modules\/lodash/,
|
|
presets: [
|
|
['@babel/preset-env', { targets: '> 0.25%, not dead' }]
|
|
],
|
|
plugins: [
|
|
'@babel/transform-runtime'
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /\.css$/i,
|
|
use: ['style-loader', 'css-loader']
|
|
},
|
|
{
|
|
test: /\.s[ac]ss$/i,
|
|
use: [
|
|
MiniCssExtractPlugin.loader,
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
sourceMap: true,
|
|
url: false
|
|
}
|
|
},
|
|
{
|
|
// Needed to resolve image url()s within @primer/css
|
|
loader: 'resolve-url-loader',
|
|
options: {}
|
|
},
|
|
{
|
|
loader: 'sass-loader',
|
|
options: {
|
|
sassOptions: {
|
|
includePaths: ['./stylesheets', './node_modules'],
|
|
options: {
|
|
sourceMap: true,
|
|
sourceMapContents: false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
filename: 'index.css'
|
|
}),
|
|
new CopyWebpackPlugin({
|
|
patterns: [
|
|
{ from: 'node_modules/@primer/css/fonts', to: 'fonts' }
|
|
]
|
|
}),
|
|
new EnvironmentPlugin({
|
|
NODE_ENV: 'development', // use 'development' unless process.env.NODE_ENV is defined
|
|
DEBUG: false
|
|
}),
|
|
new ProvidePlugin({
|
|
process: 'process/browser'
|
|
})
|
|
]
|
|
}
|