Skip to content

Commit

Permalink
Merge pull request #502 from GSA/ss_deploy_fix
Browse files Browse the repository at this point in the history
added patterns section
  • Loading branch information
Sean authored Oct 2, 2020
2 parents 9b75857 + 8141fc8 commit f381ee3
Showing 1 changed file with 59 additions and 59 deletions.
118 changes: 59 additions & 59 deletions config/webpack/webpack.shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,64 @@ if (process.env.OUTPUT_PATH) {
OUTPUT_PATH = join(rootDir, '/dist')
}

const patterns = [
{ from: 'styles', to: 'css' },
{ from: 'assets/data', to: 'assets/data' },
{ from: 'assets/img', to: 'assets/img' },
{
from: './src/components/federal-agencies/html',
to: 'src/components/federal-agencies/html'
},
{
from: 'img/**/*',
to: 'styles/uswds/',
context: path.resolve(rootDir, 'node_modules', 'uswds', 'dist')
},
{
from: './src/components/about-codedotgov/html',
to: join(OUTPUT_PATH, '/src/components/about-codedotgov/html')
},
{
from: './src/components/federal-agencies/html',
to: join(OUTPUT_PATH, '/src/components/federal-agencies/html')
},
{
from: 'fonts/**/*',
to: 'uswds/',
context: path.resolve(rootDir, 'node_modules', 'uswds', 'dist')
},
{
from: 'fonts/*',
to: 'uswds/',
context: path.resolve(rootDir, 'assets')
},
{
from: 'fonts/*',
to: 'assets/',
context: path.resolve(rootDir, 'assets')
},
{
from: './404.html',
to: join(OUTPUT_PATH, '404.html')
},
{
from: 'node_modules/@webcomponents/custom-elements/custom-elements.min.js',
to: 'polyfills/custom-elements.js'
},
{
from: 'node_modules/custom-event-polyfill/polyfill.js',
to: 'polyfills/custom-event.js'
},
{
from: 'node_modules/whatwg-fetch/dist/fetch.umd.js',
to: 'polyfills/fetch.js'
},
{
from: 'node_modules/url-search-params-polyfill/index.js',
to: 'polyfills/url-search-params.js'
}
]

if (BRANCH.includes('production')) {
// only include sitemap if building for production on code.gov
patterns.push({
Expand All @@ -57,65 +115,7 @@ module.exports = {
SITE_CONFIG: JSON.stringify(SITE_CONFIG)
}),
new EnvironmentPlugin(['CODE_GOV_API_BASE', 'CODE_GOV_API_KEY', 'CODE_GOV_TASKS_URL']),
new CopyPlugin({
patterns: [
{ from: 'styles', to: 'css' },
{ from: 'assets/data', to: 'assets/data' },
{ from: 'assets/img', to: 'assets/img' },
{
from: './src/components/federal-agencies/html',
to: 'src/components/federal-agencies/html'
},
{
from: 'img/**/*',
to: 'styles/uswds/',
context: path.resolve(rootDir, 'node_modules', 'uswds', 'dist')
},
{
from: './src/components/about-codedotgov/html',
to: join(OUTPUT_PATH, '/src/components/about-codedotgov/html')
},
{
from: './src/components/federal-agencies/html',
to: join(OUTPUT_PATH, '/src/components/federal-agencies/html')
},
{
from: 'fonts/**/*',
to: 'uswds/',
context: path.resolve(rootDir, 'node_modules', 'uswds', 'dist')
},
{
from: 'fonts/*',
to: 'uswds/',
context: path.resolve(rootDir, 'assets')
},
{
from: 'fonts/*',
to: 'assets/',
context: path.resolve(rootDir, 'assets')
},
{
from: './404.html',
to: join(OUTPUT_PATH, '404.html')
},
{
from: 'node_modules/@webcomponents/custom-elements/custom-elements.min.js',
to: 'polyfills/custom-elements.js'
},
{
from: 'node_modules/custom-event-polyfill/polyfill.js',
to: 'polyfills/custom-event.js'
},
{
from: 'node_modules/whatwg-fetch/dist/fetch.umd.js',
to: 'polyfills/fetch.js'
},
{
from: 'node_modules/url-search-params-polyfill/index.js',
to: 'polyfills/url-search-params.js'
}
]
}),
new CopyPlugin({ patterns }),
new ImageminPlugin({ test: /\.(jpe?g|png|gif|svg)$/i }),
new HtmlWebpackPlugin({
hash: true,
Expand Down

0 comments on commit f381ee3

Please sign in to comment.