Skip to content

Commit

Permalink
import.meta.env.SSR (#1345)
Browse files Browse the repository at this point in the history
* add import.meta.env.SSR

* fix bad merge conflict

* update snapshots
  • Loading branch information
FredKSchott authored Oct 18, 2020
1 parent 5890ecd commit 98b36d3
Show file tree
Hide file tree
Showing 34 changed files with 55 additions and 50 deletions.
6 changes: 3 additions & 3 deletions snowpack/src/build/build-import-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export function wrapHtmlResponse({
}) {
// replace %PUBLIC_URL% (along with surrounding slashes, if any)
code = code.replace(/\/?%PUBLIC_URL%\/?/g, isDev ? '/' : config.buildOptions.baseUrl);

// replace %MODE%
code = code.replace(/%MODE%/g, mode);

Expand Down Expand Up @@ -229,10 +228,11 @@ export async function wrapImportProxy({
return generateDefaultImportProxy(url);
}

export function generateEnvModule(mode: 'development' | 'production') {
const envObject = getSnowpackPublicEnvVariables();
export function generateEnvModule({mode, isSSR}: {mode: 'development' | 'production', isSSR: boolean}) {
const envObject: Record<string, string | boolean | undefined> = getSnowpackPublicEnvVariables();
envObject.MODE = mode;
envObject.NODE_ENV = mode;
envObject.SSR = isSSR;
return `export default ${JSON.stringify(envObject)};`;
}

Expand Down
9 changes: 7 additions & 2 deletions snowpack/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ class FileBuilder {

async buildFile() {
this.filesToResolve = {};
const isSSR = this.config.experiments.ssr;
const srcExt = path.extname(this.filepath);
const fileOutput = this.mountEntry.static
? {[srcExt]: {code: await readFile(this.filepath)}}
: await buildFile(this.filepath, {
plugins: this.config.plugins,
isDev: false,
isSSR: this.config.experiments.ssr,
isSSR,
isHmrEnabled: false,
sourceMaps: this.config.buildOptions.sourceMaps,
});
Expand Down Expand Up @@ -296,6 +297,7 @@ class FileBuilder {
export async function command(commandOptions: CommandOptions) {
const {config} = commandOptions;
const isDev = !!config.buildOptions.watch;
const isSSR = !!config.experiments.ssr;

// Fill in any command-specific plugin methods.
// NOTE: markChanged only needed during dev, but may not be true for all.
Expand Down Expand Up @@ -343,7 +345,10 @@ export async function command(commandOptions: CommandOptions) {

// Write the `import.meta.env` contents file to disk
logger.debug(`generating meta files`);
await fs.writeFile(path.join(internalFilesBuildLoc, 'env.js'), generateEnvModule('production'));
await fs.writeFile(
path.join(internalFilesBuildLoc, 'env.js'),
generateEnvModule({mode: 'production', isSSR}),
);
if (getIsHmrEnabled(config)) {
await fs.writeFile(path.resolve(internalFilesBuildLoc, 'hmr-client.js'), HMR_CLIENT_CODE);
await fs.writeFile(
Expand Down
2 changes: 1 addition & 1 deletion snowpack/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export async function startServer(commandOptions: CommandOptions): Promise<Serve
}
if (reqPath === getMetaUrlPath('/env.js', config)) {
return {
contents: encodeResponse(generateEnvModule('development'), encoding),
contents: encodeResponse(generateEnvModule({mode: 'development', isSSR}), encoding),
originalFileLoc: null,
responseFileName: 'env.js',
};
Expand Down
2 changes: 1 addition & 1 deletion test/build/base-url-homepage/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Array [
]
`;

exports[`snowpack build base-url-homepage: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build base-url-homepage: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build base-url-homepage: build/_dist_/index.js 1`] = `
"import __SNOWPACK_ENV__ from '../__snowpack__/env.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/base-url-remote/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Array [
]
`;

exports[`snowpack build base-url-remote: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build base-url-remote: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build base-url-remote: build/_dist_/index.js 1`] = `
"import __SNOWPACK_ENV__ from '../__snowpack__/env.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/base-url/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Array [
]
`;

exports[`snowpack build base-url: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build base-url: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build base-url: build/_dist_/index.js 1`] = `
"import __SNOWPACK_ENV__ from '../__snowpack__/env.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/bugfix-named-import/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Array [
]
`;

exports[`snowpack build bugfix-named-import: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build bugfix-named-import: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build bugfix-named-import: build/_dist_/index.js 1`] = `
"import {flatten as _$v4} from '../web_modules/array-flatten.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/cdn/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Array [
]
`;

exports[`snowpack build cdn: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build cdn: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build cdn: build/_dist_/index.js 1`] = `
"import __SNOWPACK_ENV__ from '../__snowpack__/env.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/config-clean/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Array [
]
`;

exports[`snowpack build config-clean: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build config-clean: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build config-clean: build/_dist_/index.js 1`] = `"console.log('fooey');"`;
2 changes: 1 addition & 1 deletion test/build/config-extends-plugins/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Array [
]
`;

exports[`snowpack build config-extends-plugins: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build config-extends-plugins: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build config-extends-plugins: build/_dist_/index.js 1`] = `"console.log('fooey');"`;

Expand Down
2 changes: 1 addition & 1 deletion test/build/config-external-package/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Array [
]
`;

exports[`snowpack build config-external-package: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build config-external-package: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build config-external-package: build/_dist_/index.js 1`] = `
"import 'fs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default {"MODE":"production","NODE_ENV":"production"};
export default {"MODE":"production","NODE_ENV":"production","SSR":false};
2 changes: 1 addition & 1 deletion test/build/config-out-flag/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Array [
]
`;

exports[`snowpack build config-out-flag: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build config-out-flag: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build config-out-flag: build/package.json 1`] = `
"{
Expand Down
2 changes: 1 addition & 1 deletion test/build/config-out/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Array [
]
`;

exports[`snowpack build config-out: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build config-out: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build config-out: build/package.json 1`] = `
"{
Expand Down
2 changes: 1 addition & 1 deletion test/build/config-treeshake/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Array [
]
`;

exports[`snowpack build config-treeshake: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build config-treeshake: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build config-treeshake: build/_dist_/index.js 1`] = `
"// Test: complex comments intermixed with imports
Expand Down
2 changes: 1 addition & 1 deletion test/build/config-ts-format/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Array [
]
`;

exports[`snowpack build config-ts-format: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build config-ts-format: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build config-ts-format: build/_dist_/index.js 1`] = `"console.log('fooey');"`;
2 changes: 1 addition & 1 deletion test/build/custom-modules-dir/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Array [
]
`;

exports[`snowpack build custom-modules-dir: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build custom-modules-dir: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build custom-modules-dir: build/_dist_/index.js 1`] = `
"import {flatten} from '../my_modules/array-flatten.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/entrypoint-ids/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Array [
]
`;

exports[`snowpack build entrypoint-ids: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build entrypoint-ids: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build entrypoint-ids: build/_dist_/index.js 1`] = `
"import '../web_modules/chalk.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/html-environment-variables/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Array [
]
`;

exports[`snowpack build html-environment-variables: build/__snowpack__/env.js 1`] = `"export default {\\"SNOWPACK_PUBLIC_MY_ENV_VAR\\":\\"my-var-replacement-configured-in-package.json\\",\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build html-environment-variables: build/__snowpack__/env.js 1`] = `"export default {\\"SNOWPACK_PUBLIC_MY_ENV_VAR\\":\\"my-var-replacement-configured-in-package.json\\",\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build html-environment-variables: build/index.css 1`] = `
"#img {
Expand Down
2 changes: 1 addition & 1 deletion test/build/legacy-mount-scripts/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Array [
]
`;

exports[`snowpack build legacy-mount-scripts: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build legacy-mount-scripts: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build legacy-mount-scripts: build/_dist_/index.js 1`] = `
"import {flatten} from '../web_modules/array-flatten.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/meta-dir-local-baseurl/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function doNothing() {
console.log(import.meta.env)"
`;

exports[`snowpack build meta-dir-local-baseurl: build/static/snowpack/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build meta-dir-local-baseurl: build/static/snowpack/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build meta-dir-local-baseurl: build/sub/index.js 1`] = `
"import __SNOWPACK_ENV__ from '../static/snowpack/env.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/meta-dir-remote-baseurl/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function doNothing() {
console.log(import.meta.env)"
`;

exports[`snowpack build meta-dir-remote-baseurl: build/static/snowpack/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build meta-dir-remote-baseurl: build/static/snowpack/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build meta-dir-remote-baseurl: build/sub/index.js 1`] = `
"import __SNOWPACK_ENV__ from '../static/snowpack/env.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/meta-dir/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function doNothing() {
console.log(import.meta.env)"
`;

exports[`snowpack build meta-dir: build/static/snowpack/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build meta-dir: build/static/snowpack/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build meta-dir: build/sub/index.js 1`] = `
"import __SNOWPACK_ENV__ from '../static/snowpack/env.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/module-preload/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Array [
]
`;

exports[`snowpack build module-preload: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build module-preload: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build module-preload: build/_dist_/about.js 1`] = `"console.log(\\"about page\\");"`;

Expand Down
2 changes: 1 addition & 1 deletion test/build/module-resolution/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Array [
]
`;

exports[`snowpack build module-resolution: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build module-resolution: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build module-resolution: build/folder-1/folder-2/index.html 1`] = `
"<html>
Expand Down
2 changes: 1 addition & 1 deletion test/build/package-bootstrap/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Array [
]
`;

exports[`snowpack build package-bootstrap: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build package-bootstrap: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build package-bootstrap: build/_dist_/index.js 1`] = `
"import '../web_modules/bootstrap/dist/css/bootstrap.min.css.proxy.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/package-tippy-js/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Array [
]
`;

exports[`snowpack build package-tippy-js: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build package-tippy-js: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build package-tippy-js: build/_dist_/index.js 1`] = `
"import '../web_modules/tippyjs/dist/tippy.css.proxy.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/plugin-build-script/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Array [
]
`;

exports[`snowpack build plugin-build-script: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build plugin-build-script: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build plugin-build-script: build/_dist_/index.js 1`] = `
"const msg = 'I’m a TypeScript file';
Expand Down
2 changes: 1 addition & 1 deletion test/build/plugin-optimize/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Array [
]
`;

exports[`snowpack build plugin-optimize: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build plugin-optimize: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build plugin-optimize: build/_dist_/icon.svg.proxy.js 1`] = `"export default \\"/_dist_/icon.svg\\";"`;

Expand Down
2 changes: 1 addition & 1 deletion test/build/plugin-run-script/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Array [
]
`;

exports[`snowpack build plugin-run-script: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build plugin-run-script: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build plugin-run-script: build/css/index.css 1`] = `
"body {
Expand Down
2 changes: 1 addition & 1 deletion test/build/resolve-imports/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Array [
]
`;

exports[`snowpack build resolve-imports: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build resolve-imports: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build resolve-imports: build/_dist_/components/index.js 1`] = `
"import sort from '../sort.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/resource-proxy/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Array [
]
`;

exports[`snowpack build resource-proxy: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build resource-proxy: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build resource-proxy: build/_dist_/index.js 1`] = `
"import './styles.css.proxy.js';
Expand Down
2 changes: 1 addition & 1 deletion test/build/transform-sourcemap/__snapshots__
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Array [
]
`;

exports[`snowpack build transform-sourcemap: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\"};"`;
exports[`snowpack build transform-sourcemap: build/__snowpack__/env.js 1`] = `"export default {\\"MODE\\":\\"production\\",\\"NODE_ENV\\":\\"production\\",\\"SSR\\":false};"`;

exports[`snowpack build transform-sourcemap: build/_dist_/index.js 1`] = `
"import './submodule.js';
Expand Down
Loading

1 comment on commit 98b36d3

@vercel
Copy link

@vercel vercel bot commented on 98b36d3 Oct 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.