forked from GSA/fedramp-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnowpack.config.js
75 lines (73 loc) · 1.87 KB
/
snowpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const config = require('./src/shared/project-config');
const BASEURL = process.env.BASEURL || '';
const GITHUB = {
owner: process.env.OWNER || '18F',
repository: process.env.REPOSITORY || 'fedramp-automation',
branch: process.env.BRANCH || 'develop',
};
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
alias: {
'@asap': './src',
},
env: {
BASEURL,
GITHUB,
},
mount: {
src: { url: '/dist' },
[config.PUBLIC_PATH]: { url: '/', static: true },
[config.REGISTRY_PATH]: { url: '/xml', static: true },
[config.BASELINES_PATH]: {
url: '/baselines',
static: true,
},
'node_modules/uswds/dist/fonts': { url: '/uswds/fonts', static: true },
'node_modules/uswds/dist/img': { url: '/uswds/img', static: true },
'node_modules/uswds/dist/js': { url: '/uswds/js', static: true },
//validations: { url: '/validations', static: true },
},
exclude: ['**/node_modules/**/*', '**/src/cli/**'],
plugins: [
'@snowpack/plugin-react-refresh',
'@snowpack/plugin-dotenv',
'@snowpack/plugin-postcss',
[
'@snowpack/plugin-sass',
{
loadPath: './node_modules/uswds/dist/scss',
},
],
'@snowpack/plugin-webpack',
[
'@snowpack/plugin-typescript',
{
/* Yarn PnP workaround: see https://www.npmjs.com/package/@snowpack/plugin-typescript */
...(process.versions.pnp ? { tsc: 'yarn pnpify tsc' } : {}),
},
],
[
'snowpack-plugin-raw-file-loader',
{
exts: ['.txt', '.sch'],
},
],
],
routes: [
/* Enable an SPA Fallback in development: */
// {"match": "routes", "src": ".*", "dest": "/index.html"},
],
optimize: {
/* Example: Bundle your final build: */
// "bundle": true,
},
packageOptions: {
/* ... */
},
devOptions: {
/* ... */
},
buildOptions: {
baseUrl: BASEURL,
},
};