Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 37d462b

Browse files
authored
Merge pull request #290 from GSA/sc_add-uswds
* Update to USWDS v2.0.3 * don't lint uswds imported files * switch to full import of uswds * add optimize-css-assets-webpack-plugin
2 parents 55897ba + 8346f52 commit 37d462b

541 files changed

Lines changed: 63554 additions & 244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ src/components/plugins
44
# Ignore dist and docs files
55
dist/*
66
docs/*
7-
src/**/**/*.json
7+
src/**/**/*.json
8+
styles/uswds/*

config/webpack/webpack.shared.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
55
const DefinePlugin = require('webpack/lib/DefinePlugin')
66
const EnvironmentPlugin = require('webpack/lib/EnvironmentPlugin')
77
const HtmlWebpackPlugin = require('html-webpack-plugin')
8+
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
89
const sass = require('sass')
910
const autoprefixer = require('autoprefixer')
1011
const mqpacker = require('css-mqpacker')
@@ -55,6 +56,18 @@ const patterns = [
5556
from: './assets/img',
5657
to: join(OUTPUT_PATH, '/assets/img')
5758
},
59+
{
60+
from: './styles/uswds/img',
61+
to: join(OUTPUT_PATH, '/uswds/img')
62+
},
63+
{
64+
from: './styles/uswds/js',
65+
to: join(OUTPUT_PATH, '/uswds/js')
66+
},
67+
{
68+
from: './styles/uswds/fonts',
69+
to: join(OUTPUT_PATH, '/uswds/fonts')
70+
},
5871
{
5972
from: './src/components/about-page/html',
6073
to: join(OUTPUT_PATH, '/src/components/about-page/html')
@@ -236,6 +249,13 @@ module.exports = {
236249
removeScriptTypeAttributes: true
237250
}
238251
}),
252+
new OptimizeCSSAssetsPlugin({
253+
assetNameRegExp: /\.optimize\.css$/g,
254+
cssProcessorPluginOptions: {
255+
preset: ['default', { discardComments: { removeAll: true } }]
256+
},
257+
canPrint: true
258+
}),
239259
new AppManifestWebpackPlugin({
240260
emitStats: true,
241261
logo: './assets/img/favicon.png',

0 commit comments

Comments
 (0)