├── .changeset ├── README.md └── config.json ├── .editorconfig ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── ---bug-report.yml │ ├── ---feature-request.yml │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── format.yml │ ├── lint.yml │ ├── release.yml │ └── test.yml ├── .gitignore ├── .prettierignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── create-snowpack-app ├── README.md ├── app-scripts-lit-element │ ├── package.json │ ├── snowpack.config.js │ └── tsconfig.base.json ├── app-scripts-preact │ ├── babel.config.json │ ├── jest.config.js │ ├── jest │ │ ├── babelTransform.js │ │ ├── cssTransform.js │ │ └── fileTransform.js │ ├── package.json │ ├── snowpack.config.js │ └── tsconfig.base.json ├── app-scripts-react │ ├── babel.config.json │ ├── jest.config.js │ ├── jest │ │ ├── babelTransform.js │ │ ├── cssTransform.js │ │ ├── esbuildTransform.js │ │ ├── fileTransform.js │ │ └── importMetaBabelPlugin.js │ ├── package.json │ ├── snowpack.config.js │ └── tsconfig.base.json ├── app-scripts-svelte │ ├── jest.config.js │ ├── jest │ │ ├── babelTransform.js │ │ └── importMetaBabelPlugin.js │ ├── package.json │ └── snowpack.config.js ├── app-scripts-vue │ ├── package.json │ ├── snowpack.config.js │ └── tsconfig.base.json ├── app-template-11ty │ ├── .eleventy.js │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── _includes │ │ └── layouts │ │ │ └── base.njk │ ├── _output │ │ ├── about │ │ │ └── index.html │ │ ├── index.html │ │ └── static │ │ │ ├── favicon.png │ │ │ ├── index.css │ │ │ └── logo.svg │ ├── _template │ │ ├── about.md │ │ ├── index.njk │ │ └── static │ │ │ ├── favicon.png │ │ │ ├── index.css │ │ │ ├── logo.svg │ │ │ └── robots.txt │ ├── package.json │ ├── snowpack.config.mjs │ └── src │ │ └── index.js ├── app-template-blank-typescript │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo.svg │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── index.css │ │ └── index.ts │ ├── tsconfig.json │ ├── types │ │ └── static.d.ts │ └── yarn.lock ├── app-template-blank │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo.svg │ │ └── robots.txt │ ├── snowpack.config.mjs │ └── src │ │ ├── index.css │ │ └── index.js ├── app-template-lit-element-typescript │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── babel.config.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.css │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── app-root.ts │ │ └── index.ts │ ├── tsconfig.json │ └── types │ │ └── static.d.ts ├── app-template-lit-element │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── babel.config.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.css │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.mjs │ └── src │ │ ├── app-root.js │ │ └── index.js ├── app-template-minimal │ ├── README.md │ ├── index.css │ ├── index.html │ ├── index.js │ ├── package.json │ └── snowpack.config.mjs ├── app-template-preact-typescript │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── App.css │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── index.css │ │ ├── index.tsx │ │ └── logo.png │ ├── tsconfig.json │ ├── types │ │ └── static.d.ts │ └── web-test-runner.config.js ├── app-template-preact │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── App.test.jsx │ │ ├── index.css │ │ ├── index.jsx │ │ └── logo.png │ └── web-test-runner.config.js ├── app-template-react-typescript │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── App.css │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── index.css │ │ ├── index.tsx │ │ └── logo.svg │ ├── tsconfig.json │ ├── types │ │ └── static.d.ts │ └── web-test-runner.config.js ├── app-template-react │ ├── .npmignore │ ├── .prettierrc │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── App.test.jsx │ │ ├── index.css │ │ ├── index.jsx │ │ └── logo.svg │ └── web-test-runner.config.js ├── app-template-svelte-typescript │ ├── .npmignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo.svg │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── App.svelte │ │ ├── App.test.ts │ │ └── index.ts │ ├── svelte.config.js │ ├── tsconfig.json │ ├── types │ │ └── static.d.ts │ └── web-test-runner.config.js ├── app-template-svelte │ ├── .npmignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo.svg │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── App.svelte │ │ ├── App.test.js │ │ └── index.js │ └── web-test-runner.config.js ├── app-template-vue-typescript │ ├── .npmignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo.svg │ │ └── robots.txt │ ├── snowpack.config.mjs │ ├── src │ │ ├── App.vue │ │ └── index.js │ ├── tsconfig.json │ └── types │ │ ├── shims-vue.d.ts │ │ └── static.d.ts ├── app-template-vue │ ├── .npmignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo.svg │ │ └── robots.txt │ ├── snowpack.config.mjs │ └── src │ │ ├── App.vue │ │ └── index.js └── cli │ ├── README.md │ ├── createSnowpackApp.js │ ├── index.js │ └── package.json ├── docs ├── README.md ├── concepts │ ├── build-pipeline.md │ ├── dev-server.md │ ├── hot-module-replacement.md │ └── how-snowpack-works.md ├── guides │ ├── babel.md │ ├── connecting-tools.md │ ├── hmr.md │ ├── https-ssl-certificates.md │ ├── jest.md │ ├── optimize-and-bundle.md │ ├── plugins.md │ ├── postcss.md │ ├── preact.md │ ├── react-global-imports.md │ ├── react-loadable-components.md │ ├── routing.md │ ├── sass.md │ ├── server-side-render.md │ ├── streaming-imports.md │ ├── tailwind-css.md │ ├── testing.md │ ├── upgrade-guide.md │ ├── wasm.md │ ├── web-test-runner.md │ ├── web-worker.md │ └── workbox.md ├── posts │ ├── 2020-05-26-snowpack-2-0-release.md │ ├── 2020-07-30-snowpack-2-7-release.md │ ├── 2020-12-03-snowpack-3-release-candidate.md │ └── 2021-01-13-snowpack-3-0.md ├── reference │ ├── cli-command-line-interface.md │ ├── common-error-details.md │ ├── configuration.md │ ├── environment-variables.md │ ├── hot-module-replacement.md │ ├── javascript-interface.md │ ├── plugins.md │ └── supported-files.md └── tutorials │ ├── getting-started.md │ ├── quick-start.md │ ├── react.md │ ├── svelte.md │ └── vue.md ├── esinstall ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── index.esm.mjs ├── package.json ├── src │ ├── entrypoints.ts │ ├── index.ts │ ├── rollup-plugins │ │ ├── generateProcessPolyfill.ts │ │ ├── rollup-plugin-alias.ts │ │ ├── rollup-plugin-catch-fetch.ts │ │ ├── rollup-plugin-catch-unresolved.ts │ │ ├── rollup-plugin-css.ts │ │ ├── rollup-plugin-node-process-polyfill.ts │ │ ├── rollup-plugin-stats.ts │ │ ├── rollup-plugin-strip-source-mapping.ts │ │ └── rollup-plugin-wrap-install-targets.ts │ ├── stats.ts │ ├── types.ts │ └── util.ts └── tsconfig.json ├── examples ├── .gitignore ├── https-ssl-certificates │ ├── README.md │ ├── index.html │ ├── package.json │ └── snowpack.config.js ├── react-global-imports │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.js │ └── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── index.css │ │ ├── index.jsx │ │ └── logo.svg ├── react-loadable-components │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── robots.txt │ ├── snowpack.config.js │ └── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── Async.jsx │ │ ├── index.css │ │ ├── index.jsx │ │ └── logo.svg └── tailwind │ ├── README.md │ ├── package.json │ ├── postcss.config.js │ ├── public │ ├── global.css │ └── index.html │ ├── snowpack.config.mjs │ └── tailwind.config.js ├── jest.config.js ├── jest.setup.js ├── lerna.json ├── package.json ├── plugins ├── plugin-babel │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ ├── test │ │ └── plugin-babel.test.js │ └── worker.js ├── plugin-build-script │ ├── README.md │ ├── package.json │ ├── plugin.js │ └── test │ │ └── plugin.test.js ├── plugin-dotenv │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ └── test │ │ ├── __snapshots__ │ │ └── plugin.test.js.snap │ │ ├── env │ │ ├── .env │ │ ├── .env.development │ │ ├── .env.development.local │ │ ├── .env.local │ │ ├── .env.production │ │ ├── .env.production.local │ │ ├── .env.test │ │ ├── .env.test.local │ │ └── subdir │ │ │ ├── .env │ │ │ ├── .env.development │ │ │ ├── .env.development.local │ │ │ ├── .env.local │ │ │ ├── .env.production │ │ │ ├── .env.production.local │ │ │ ├── .env.test │ │ │ └── .env.test.local │ │ ├── execPlugin.js │ │ └── plugin.test.js ├── plugin-optimize │ ├── CHANGELOG.md │ ├── README.md │ ├── lib │ │ ├── css.js │ │ ├── html.js │ │ └── js.js │ ├── package.json │ ├── plugin.js │ ├── test │ │ ├── plugin.test.js │ │ ├── serializer.js │ │ └── stubs │ │ │ └── minimal │ │ │ ├── do-not-preload-1.js │ │ │ ├── do-not-preload-2.js │ │ │ ├── do-not-preload-3.js │ │ │ ├── esm_example.js │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ ├── style.css │ │ │ └── target-es2018.js │ └── util.js ├── plugin-postcss │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ ├── test │ │ ├── fixtures │ │ │ ├── from │ │ │ │ ├── from.css │ │ │ │ ├── postcss.config.js │ │ │ │ └── style.css │ │ │ ├── postcss.config.js │ │ │ ├── style.css │ │ │ └── style.min.css │ │ └── plugin.test.js │ └── worker.js ├── plugin-react-refresh │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ └── test │ │ ├── __snapshots__ │ │ └── plugin.test.js.snap │ │ ├── plugin.test.js │ │ └── stubs │ │ ├── stub.html │ │ └── stub.js ├── plugin-run-script │ ├── README.md │ ├── package.json │ ├── plugin.js │ └── test │ │ └── plugin.test.js ├── plugin-sass │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ └── test │ │ ├── __snapshots__ │ │ └── plugin.test.js.snap │ │ ├── fixtures │ │ ├── bad │ │ │ └── bad.scss │ │ ├── sass │ │ │ ├── App.sass │ │ │ ├── _base.sass │ │ │ └── folder │ │ │ │ ├── _child-partial.sass │ │ │ │ └── _index.sass │ │ └── scss │ │ │ ├── App.scss │ │ │ ├── _base.scss │ │ │ └── folder │ │ │ └── _index.scss │ │ ├── plugin-mocked.test.js │ │ └── plugin.test.js ├── plugin-svelte │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ └── test │ │ ├── Button.svelte │ │ ├── custom-config.js │ │ ├── plugin.test.js │ │ └── svelte.config.js ├── plugin-typescript │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ └── test │ │ └── plugin.test.js ├── plugin-vue │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin-tsx-jsx.js │ ├── plugin.js │ ├── src │ │ └── script-compilers.js │ └── test │ │ ├── __snapshots__ │ │ ├── plugin-tsx-jsx.test.js.snap │ │ ├── plugin-vue-ts-tsx-jsx.test.js.snap │ │ ├── plugin.test.js.snap │ │ └── script-compilers.test.js.snap │ │ ├── plugin-tsx-jsx.test.js │ │ ├── plugin-vue-ts-tsx-jsx.test.js │ │ ├── plugin.test.js │ │ ├── script-compilers.test.js │ │ └── stubs │ │ ├── JsxContent.jsx │ │ ├── TsContent.ts │ │ ├── TsxContent.tsx │ │ ├── VueContent.vue │ │ ├── VueContentJsx.vue │ │ ├── VueContentOnlyTpl.vue │ │ ├── VueContentStyleScoped.vue │ │ ├── VueContentTs.vue │ │ ├── VueContentTsx.vue │ │ └── tsconfig.json ├── plugin-webpack │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── plugin.js │ ├── plugins │ │ ├── import-meta-fix.js │ │ └── proxy-import-resolve.js │ └── test │ │ ├── __snapshots__ │ │ └── plugin.test.js.snap │ │ ├── plugin.test.js │ │ ├── readFilesSync.js │ │ └── stubs │ │ ├── minimal │ │ ├── backpack.svg │ │ ├── index.html │ │ ├── index.js │ │ ├── package.json │ │ └── styles.css │ │ └── multiple-entrypoints │ │ ├── admin │ │ ├── index.html │ │ └── index.js │ │ ├── index.html │ │ ├── index.js │ │ └── package.json └── web-test-runner-plugin │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ └── plugin.js ├── scripts ├── release-all.js └── release.cjs ├── skypack ├── .gitignore ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── index.esm.mjs ├── package.json ├── src │ ├── index.ts │ ├── rollup-plugin-remote-cdn.ts │ └── util.ts └── tsconfig.json ├── snowpack ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets │ ├── hmr-client.js │ ├── hmr-error-overlay.js │ ├── openChrome.appleScript │ ├── require-or-import.js │ └── snowpack-init-file.js ├── index.bin.js ├── package.json ├── src │ ├── build │ │ ├── build-import-proxy.ts │ │ ├── build-pipeline.ts │ │ ├── file-builder.ts │ │ ├── file-urls.ts │ │ ├── import-css.ts │ │ ├── import-resolver.ts │ │ ├── import-sri.ts │ │ ├── optimize.ts │ │ └── process.ts │ ├── commands │ │ ├── add-rm.ts │ │ ├── build.ts │ │ ├── dev.ts │ │ ├── init.ts │ │ ├── paint.ts │ │ └── prepare.ts │ ├── config.ts │ ├── dev │ │ └── hmr.ts │ ├── hmr-server-engine.ts │ ├── index.ts │ ├── lexer-util.ts │ ├── logger.ts │ ├── plugins │ │ └── plugin-esbuild.ts │ ├── rewrite-imports.ts │ ├── scan-import-glob.ts │ ├── scan-imports.ts │ ├── sources │ │ ├── local-install.ts │ │ ├── local.ts │ │ ├── remote.ts │ │ └── util.ts │ ├── ssr-loader │ │ ├── index.ts │ │ ├── sourcemaps.ts │ │ └── transform.ts │ ├── types.ts │ └── util.ts ├── tsconfig.cjs.json └── tsconfig.json ├── test-dev ├── README.md ├── __snapshots__ │ └── dev.test.ts.snap ├── dev.test.ts ├── smoke-secure-1 │ ├── package.json │ ├── public │ │ ├── about.tmpl │ │ ├── favicon.ico │ │ ├── index.css │ │ ├── index.html │ │ └── logo.svg │ ├── snowpack.config.js │ ├── snowpack.crt │ ├── snowpack.key │ ├── src │ │ └── index.js │ └── yarn.lock ├── smoke-secure-2 │ ├── package.json │ ├── public │ │ ├── about.tmpl │ │ ├── favicon.ico │ │ ├── index.css │ │ ├── index.html │ │ └── logo.svg │ ├── snowpack.config.js │ ├── src │ │ └── index.js │ ├── tls │ │ ├── certificate.pem │ │ └── key.pem │ └── yarn.lock └── smoke │ ├── package.json │ ├── public │ ├── about.tmpl │ ├── favicon.ico │ ├── index.css │ ├── index.html │ └── logo.svg │ ├── snowpack.config.js │ ├── src │ └── index.js │ └── yarn.lock ├── test ├── build │ ├── config-loading-esm-package │ │ ├── config-loading-esm-package.test.js │ │ ├── package.json │ │ ├── snowpack.config.js │ │ └── src │ │ │ └── index.js │ ├── config-loading-mjs │ │ ├── config-loading-mjs.test.js │ │ ├── package.json │ │ ├── snowpack.config.mjs │ │ └── src │ │ │ └── index.js │ ├── config-path │ │ ├── config-path.test.js │ │ ├── index.js │ │ ├── my-config-file.js │ │ └── package.json │ ├── entrypoint-ids │ │ ├── entrypoint-ids.test.js │ │ ├── package.json │ │ └── src │ │ │ └── index.js │ ├── import-assets │ │ ├── import-assets.test.js │ │ ├── package.json │ │ ├── snowpack.config.json │ │ └── src │ │ │ ├── index.js │ │ │ ├── logo.png │ │ │ └── styles.css │ ├── package-bootstrap │ │ ├── package-bootstrap.test.js │ │ ├── package.json │ │ └── src │ │ │ ├── index.js │ │ │ └── styles.css │ ├── package-workspace │ │ ├── package-workspace.test.js │ │ ├── package.json │ │ ├── snowpack.config.js │ │ └── src │ │ │ ├── index.html │ │ │ └── index.svelte │ ├── plugin-build-script │ │ ├── package.json │ │ ├── plugin-build-script.test.js │ │ ├── snowpack.config.js │ │ └── src │ │ │ └── index.ts │ ├── plugin-hook-optimize │ │ ├── custom-optimize-plugin.js │ │ ├── package.json │ │ ├── plugin-hook-optimize.test.js │ │ ├── snowpack.config.json │ │ └── src │ │ │ ├── icon.svg │ │ │ ├── index.js │ │ │ ├── logo.png │ │ │ └── styles.css │ ├── plugin-run-script │ │ ├── package.json │ │ ├── plugin-run-script.test.js │ │ ├── public │ │ │ └── css │ │ │ │ └── index.css │ │ ├── snowpack.config.js │ │ └── src │ │ │ └── css │ │ │ └── index.scss │ ├── prepare-external-package │ │ ├── package.json │ │ ├── prepare-external-package.test.js │ │ └── src │ │ │ └── index.js │ ├── react-lazy-bundle │ │ ├── package.json │ │ ├── public │ │ │ └── index.html │ │ ├── react-lazy.test.js │ │ ├── snowpack.config.js │ │ └── src │ │ │ ├── components │ │ │ ├── App.jsx │ │ │ └── Articles.jsx │ │ │ └── index.jsx │ └── test-workspace-component │ │ ├── Layout.ts │ │ ├── README.md │ │ ├── SvelteComponent.svelte │ │ ├── index.mjs │ │ ├── package.json │ │ └── works-without-extension.ts ├── create-snowpack-app │ ├── __snapshots__ │ │ └── create-snowpack-app.test.js.snap │ └── create-snowpack-app.test.js ├── esinstall.api.test.js ├── esinstall │ ├── alias │ │ ├── alias.test.js │ │ └── package.json │ ├── cjs-autodetect-exports │ │ ├── .gitignore │ │ ├── cjs-autodetect-exports.test.js │ │ ├── package.json │ │ └── packages │ │ │ ├── cjs-invalid-exports │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ │ └── cjs-valid-exports │ │ │ ├── entrypoint.js │ │ │ └── package.json │ ├── config-package-svelte │ │ ├── config-package-svelte.test.js │ │ ├── package.json │ │ └── src │ │ │ └── index.js │ ├── dep-list-simple │ │ ├── __snapshots__ │ │ ├── dep-list-simple.test.js │ │ └── package.json │ ├── error-missing-dep │ │ ├── __snapshots__ │ │ ├── error-missing-dep.test.js │ │ └── package.json │ ├── esinstall-test-utils.js │ ├── exclude-external-packages │ │ ├── __snapshots__ │ │ ├── exclude-external-packages.test.js │ │ └── package.json │ ├── exports-only-no-main │ │ ├── .gitignore │ │ ├── exports-only-no-main.test.js │ │ ├── mod.js │ │ ├── package.json │ │ ├── pkg │ │ │ ├── mod.mjs │ │ │ └── package.json │ │ └── snowpack.config.js │ ├── exports-only │ │ ├── .gitignore │ │ ├── exports-only.test.js │ │ ├── mod.js │ │ ├── package.json │ │ ├── pkg │ │ │ ├── mod.mjs │ │ │ └── package.json │ │ └── snowpack.config.js │ ├── import-assets │ │ ├── .gitignore │ │ ├── import-assets.test.js │ │ ├── package.json │ │ └── packages │ │ │ └── mock-pkg-install-assets │ │ │ ├── css.css │ │ │ ├── jpg.jpg │ │ │ ├── json.json │ │ │ ├── package.json │ │ │ └── svg.svg │ ├── import-astro │ │ ├── .gitignore │ │ ├── import-astro.test.js │ │ ├── package.json │ │ └── packages │ │ │ └── components │ │ │ ├── Wow.astro │ │ │ └── package.json │ ├── import-missing │ │ ├── import-missing.test.js │ │ ├── package.json │ │ ├── packages │ │ │ ├── @material │ │ │ │ └── animation │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── _functions.import.scss │ │ │ │ │ ├── _functions.scss │ │ │ │ │ ├── _index.scss │ │ │ │ │ ├── _variables.import.scss │ │ │ │ │ ├── _variables.scss │ │ │ │ │ ├── dist │ │ │ │ │ ├── mdc.animation.d.ts │ │ │ │ │ ├── mdc.animation.js │ │ │ │ │ ├── mdc.animation.js.map │ │ │ │ │ └── mdc.animation.min.js │ │ │ │ │ ├── index.d.ts │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.js.map │ │ │ │ │ ├── package.json │ │ │ │ │ ├── types.d.ts │ │ │ │ │ ├── types.js │ │ │ │ │ ├── types.js.map │ │ │ │ │ ├── util.d.ts │ │ │ │ │ ├── util.js │ │ │ │ │ └── util.js.map │ │ │ └── tslib │ │ │ │ ├── CopyrightNotice.txt │ │ │ │ ├── LICENSE.txt │ │ │ │ ├── package.json │ │ │ │ ├── tslib.d.ts │ │ │ │ ├── tslib.es6.html │ │ │ │ ├── tslib.es6.js │ │ │ │ ├── tslib.html │ │ │ │ └── tslib.js │ │ └── src │ │ │ └── index.js │ ├── import-named-from-default │ │ ├── import-named-from-default.test.js │ │ ├── package.json │ │ └── package │ │ │ └── default-only-esm │ │ │ ├── index.js │ │ │ └── package.json │ ├── import-node-builtin │ │ ├── .gitignore │ │ ├── error-node-builtin-unresolved.test.js │ │ ├── package.json │ │ └── packages │ │ │ └── bad-node-builtin-pkg │ │ │ ├── entrypoint.js │ │ │ └── package.json │ ├── import-nothing │ │ ├── import-nothing.test.js │ │ └── package.json │ ├── import-types │ │ ├── .gitignore │ │ ├── import-types.test.js │ │ ├── package.json │ │ └── packages │ │ │ └── type-only-pkg │ │ │ ├── index.d.ts │ │ │ └── package.json │ ├── named-exports │ │ ├── .gitignore │ │ ├── named-exports.test.js │ │ ├── package.json │ │ └── packages │ │ │ ├── cjs-named-exports-obj │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ │ ├── cjs-named-exports-reexported │ │ │ ├── entrypoint.js │ │ │ ├── package.json │ │ │ └── reexported.js │ │ │ ├── cjs-named-exports-simple │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ │ └── umd-named-exports │ │ │ ├── autolayout.js │ │ │ └── package.json │ ├── node-env │ │ ├── .gitignore │ │ ├── node-env.test.js │ │ ├── package.json │ │ └── packages │ │ │ └── node-env-mock-pkg │ │ │ ├── entrypoint.js │ │ │ └── package.json │ ├── package-entrypoints │ │ ├── .gitignore │ │ ├── browser-dot-slash-index-js │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── browser-dot-slash-index │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── browser-dot-slash │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── browser-dot │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── browser-index-js │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── browser-index │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── browser-no-valid │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── browser-path │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-dot-no-slash │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-dot-slash │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-internal-imports │ │ │ ├── entrypoint.js │ │ │ ├── imported-by-entrypoint.js │ │ │ ├── imports-entrypoint.js │ │ │ └── package.json │ │ ├── export-map-object-browser-object │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-object-browser │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-object-default │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-object-import │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-object-no-key │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-object-require │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── export-map-star │ │ │ ├── entrypoint.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ └── extras │ │ │ │ ├── one.js │ │ │ │ ├── other.css │ │ │ │ ├── three.js │ │ │ │ └── two.js │ │ ├── export-map-trailing-slash │ │ │ ├── dist │ │ │ │ ├── esm │ │ │ │ │ └── helpers.js │ │ │ │ └── index.js │ │ │ ├── entrypoint.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ ├── extras │ │ │ │ ├── one.js │ │ │ │ ├── other.css │ │ │ │ ├── three.js │ │ │ │ └── two.js │ │ │ │ └── more │ │ │ │ └── one.js │ │ ├── implicit-main │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── jsnext-main │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── main-folder │ │ │ ├── entrypoint │ │ │ │ └── index.js │ │ │ └── package.json │ │ ├── module │ │ │ ├── entrypoint.js │ │ │ └── package.json │ │ ├── package-entrypoints-browser.test.js │ │ ├── package-entrypoints-export-map.test.js │ │ ├── package-entrypoints-general.test.js │ │ ├── package.json │ │ └── pkg-with-dot.in-the-name │ │ │ ├── entrypoint.js │ │ │ └── package.json │ ├── package-node-fetch │ │ ├── .gitignore │ │ ├── package-node-fetch.test.js │ │ ├── package.json │ │ └── packages │ │ │ └── dep-node-fetch-mock-pkg │ │ │ ├── entrypoint.js │ │ │ └── package.json │ ├── package-react │ │ ├── __snapshots__ │ │ ├── package-react.test.js │ │ ├── package.json │ │ └── src │ │ │ └── index.js │ ├── polyfill-node │ │ ├── .gitignore │ │ ├── package.json │ │ ├── packages │ │ │ └── node-builtin-pkg │ │ │ │ ├── entrypoint.js │ │ │ │ └── package.json │ │ └── polyfill-node.test.js │ ├── rollup │ │ ├── .gitignore │ │ ├── package.json │ │ ├── rollup.test.js │ │ └── src │ │ │ └── index.js │ ├── source-map-strip │ │ ├── __snapshots__ │ │ ├── package.json │ │ └── source-map-strip.test.js │ ├── sub-package-json │ │ ├── .gitignore │ │ ├── package.json │ │ └── sub-package-json.test.js │ └── tree-shake-expression │ │ ├── .gitignore │ │ ├── inner-module │ │ ├── main.js │ │ └── package.json │ │ ├── package.json │ │ └── tree-shake-expression.test.js ├── fixture-utils.js ├── rollup-plugins.test.js ├── snowpack │ ├── __template__ │ │ └── index.test.js │ ├── cdnUrls │ │ └── index.test.js │ ├── config │ │ ├── alias │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.js.snap │ │ │ └── index.test.js │ │ ├── buildOptions.baseUrl │ │ │ └── index.test.js │ │ ├── buildOptions.jsxInject │ │ │ └── index.test.js │ │ ├── buildOptions.metaUrlPath │ │ │ └── index.test.js │ │ ├── buildOptions.out │ │ │ └── index.test.js │ │ ├── env │ │ │ └── index.test.js │ │ ├── invalid │ │ │ └── index.test.js │ │ ├── mode │ │ │ └── index.test.js │ │ ├── mount │ │ │ └── index.test.js │ │ ├── optimize │ │ │ └── index.test.js │ │ ├── packageOptions.external │ │ │ └── index.test.js │ │ ├── packageOptions.packageLookupFields │ │ │ └── index.test.js │ │ ├── packageOptions.source │ │ │ └── index.test.js │ │ ├── plugins │ │ │ ├── extends │ │ │ │ └── index.test.js │ │ │ └── instantiatedObject │ │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.js.snap │ │ │ │ └── index.test.js │ │ └── withExtension │ │ │ └── index.test.js │ ├── cssModules │ │ └── index.test.js │ ├── import-sri.test.ts │ ├── import │ │ ├── css.ts │ │ │ └── index.test.js │ │ ├── dotFolder │ │ │ └── index.test.js │ │ ├── glob │ │ │ └── index.test.js │ │ ├── json │ │ │ ├── __snapshots__ │ │ │ │ └── index.test.js.snap │ │ │ └── index.test.js │ │ └── ts │ │ │ └── index.test.js │ ├── moduleResolution │ │ └── index.test.js │ ├── namedImport │ │ ├── __snapshots__ │ │ │ └── index.test.js.snap │ │ └── index.test.js │ ├── package │ │ ├── @nivo │ │ │ └── index.test.js │ │ ├── bootstrap │ │ │ └── index.test.js │ │ ├── tippy │ │ │ └── index.test.js │ │ └── workspace │ │ │ └── index.test.js │ ├── plugin │ │ ├── babel │ │ │ └── index.test.js │ │ ├── buildScript │ │ │ └── index.test.js │ │ ├── custom │ │ │ └── index.test.js │ │ ├── customTransform │ │ │ └── index.test.js │ │ ├── runScript │ │ │ └── index.test.js │ │ ├── sass │ │ │ └── index.test.js │ │ ├── svelte │ │ │ └── index.test.js │ │ └── vue │ │ │ └── index.test.js │ ├── runtime │ │ └── runtime.test.js │ ├── utf8 │ │ └── index.test.js │ └── util.test.ts └── test-utils.js ├── www ├── .gitignore ├── LICENSE ├── README.md ├── astro.config.mjs ├── package.json ├── public │ ├── favicon │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ └── site.webmanifest │ ├── img │ │ ├── JSAwardWinner.jpg │ │ ├── JSAwardWinner.png │ │ ├── ReactGuide.jpg │ │ ├── SvelteGuide.jpg │ │ ├── backpack.svg │ │ ├── banner-2.jpg │ │ ├── browser-logos-all.png │ │ ├── extra-space-3.jpg │ │ ├── extra-space-4.jpg │ │ ├── extra-space-4.mp4 │ │ ├── guides │ │ │ ├── folder-structure.png │ │ │ ├── getting-started │ │ │ │ ├── hello-world.gif │ │ │ │ ├── npm-snowpack-confetti.gif │ │ │ │ ├── run-snowpack.jpg │ │ │ │ ├── snowpack-build.gif │ │ │ │ └── snowpack-font-css.jpg │ │ │ ├── react │ │ │ │ ├── buttons.svg │ │ │ │ ├── folderstructure.png │ │ │ │ ├── hmr.gif │ │ │ │ ├── minimalist-hello-world-react-logo.png │ │ │ │ ├── minimalist-hello-world-react-timer.png │ │ │ │ ├── minimalist-hello-world-react.png │ │ │ │ ├── minimalist-hello-world.png │ │ │ │ ├── react-fast-refresh.gif │ │ │ │ ├── react.gif │ │ │ │ └── snowpack-logo-tiny.svg │ │ │ └── svelte │ │ │ │ ├── svelte-component-snowpack.gif │ │ │ │ ├── svelte-logo-snowpack.jpg │ │ │ │ ├── svelte-logo-style-snowpack.gif │ │ │ │ └── svelte-snowpack-counter-1.gif │ │ ├── how-does-it-work.jpg │ │ ├── logo.png │ │ ├── logos │ │ │ ├── babel.svg │ │ │ ├── jest.svg │ │ │ ├── modern-web.svg │ │ │ ├── postcss.svg │ │ │ ├── preact.svg │ │ │ ├── react.svg │ │ │ ├── sass.svg │ │ │ ├── svelte.svg │ │ │ ├── tailwind.svg │ │ │ ├── vue.png │ │ │ ├── wasm.svg │ │ │ └── workbox.svg │ │ ├── news │ │ │ ├── 3d-product.jpeg │ │ │ └── learn-snow-youtube.jpg │ │ ├── nomodule.png │ │ ├── plug-light.svg │ │ ├── plug-regular.svg │ │ ├── post-snowpackv3-esbuild.png │ │ ├── post-snowpackv3-jsapi.png │ │ ├── post-snowpackv3-routes.png │ │ ├── post-snowpackv3-runtime.png │ │ ├── react-guide.png │ │ ├── react-snarky-tweet-2.png │ │ ├── react-snarky-tweet.png │ │ ├── rocket-solid.svg │ │ ├── snowpack-27-screenshot-1.png │ │ ├── snowpack-27-screenshot-2.png │ │ ├── snowpack-27-screenshot-3.png │ │ ├── snowpack-build-example.png │ │ ├── snowpack-build-mov.mov │ │ ├── snowpack-dev-example.png │ │ ├── snowpack-dev-startup-2.png │ │ ├── snowpack-dev-startup.png │ │ ├── snowpack-logo-black.png │ │ ├── snowpack-logo-dark.png │ │ ├── snowpack-logo-white.png │ │ ├── snowpack-unbundled-example-2.png │ │ ├── snowpack-unbundled-example-3.png │ │ ├── snowpack-unbundled-example.png │ │ ├── snowpack-wordmark-black.png │ │ ├── snowpack-wordmark-white.png │ │ ├── snowpackskypack.mp4 │ │ ├── snowpackskypack.webm │ │ ├── social-2.jpg │ │ ├── social-2.png │ │ ├── social-3.jpg │ │ ├── social-4.jpg │ │ ├── social-4.png │ │ ├── social-snowpackv3.jpg │ │ ├── social.jpg │ │ ├── stat.jpg │ │ ├── streaming-imports-demo.mp4 │ │ ├── streaming-imports-demo.webm │ │ ├── svelte-ts.png │ │ └── treeshaking.jpg │ ├── js │ │ └── index.js │ ├── robots.txt │ └── styles │ │ ├── _animations.scss │ │ ├── _card-grid.scss │ │ ├── _github-markdown.scss │ │ ├── _globals.scss │ │ ├── _prism.scss │ │ ├── _typography.scss │ │ ├── _utils.scss │ │ ├── _var.scss │ │ └── global.scss ├── scripts │ └── copy.js ├── src │ ├── components │ │ ├── Banner.astro │ │ ├── BaseHead.astro │ │ ├── BaseLayout.astro │ │ ├── Button.astro │ │ ├── Card.css │ │ ├── Card.jsx │ │ ├── CompanyLogo.jsx │ │ ├── Hero.astro │ │ ├── MainLayout.astro │ │ ├── Menu.astro │ │ ├── Nav.astro │ │ ├── NewsAssets.svelte │ │ ├── NewsTitle.vue │ │ ├── PluginSearchPage.jsx │ │ ├── PluginSearchPage.module.css │ │ ├── PokemonLookup.astro │ │ ├── Subnav.astro │ │ ├── docsearch.js │ │ └── index.ts │ ├── data │ │ ├── news.json │ │ └── users.json │ ├── layouts │ │ ├── content-with-cover.astro │ │ ├── content.astro │ │ └── post.astro │ └── pages │ │ ├── 404.astro │ │ ├── guides.astro │ │ ├── index.astro │ │ ├── news.astro │ │ └── plugins.astro └── yarn.lock └── yarn.lock /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "linked": [], 6 | "access": "public", 7 | "baseBranch": "main", 8 | "ignore": ["@snowpack/test-*"] 9 | } 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @snowpackjs/maintainers 2 | docs/* @snowpackjs/docs 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 💬 Everything else 4 | about: Ask questions and get help from our community! 5 | url: https://github.com/withastro/snowpack/discussions 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Changes 2 | 3 | 4 | 5 | 6 | ## Testing 7 | 8 | 9 | 10 | 11 | ## Docs 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint Code 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | env: 10 | node_version: 14 11 | 12 | jobs: 13 | lint: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Use Node.js ${{ env.node_version }} 18 | uses: actions/setup-node@v2 19 | with: 20 | node-version: ${{ env.node_version }} 21 | - name: lint 22 | run: | 23 | yarn --ignore-engines --frozen-lockfile 24 | yarn build 25 | yarn lint 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .build 3 | .idea 4 | .snowpack 5 | .vercel 6 | lerna-debug.log 7 | node_modules 8 | package-lock.json 9 | create-snowpack-app/*/build 10 | test/__temp__ 11 | test/build/**/build 12 | test/build/**/TEST_BUILD_OUT 13 | test/build/**/web_modules 14 | test/create-snowpack-app/test-install 15 | test/esinstall/**/web_modules 16 | yarn-error.log 17 | 18 | # Ignore files that are copied from /docs 19 | www/_template/**/*.md 20 | !www/_template/posts/**/*.md 21 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | vendor 2 | dist 3 | test/build/**/build 4 | create-snowpack-app/**/build 5 | packages 6 | pkg 7 | TEST_BUILD_OUT 8 | web_modules 9 | test/create-snowpack-app/test-install 10 | .snowpack 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Version 3.x 4 | 5 | The CHANGELOG.md for the current 3.x version of Snowpack is maintained in the `/snowpack` directory at: https://github.com/withastro/snowpack/blob/main/snowpack/CHANGELOG.md 6 | 7 | ## Version 2.x 8 | 9 | The CHANGELOG.md for version 2.x is currently maintained in a discussion so that you can subscribe for updates: 10 | **https://github.com/withastro/snowpack/discussions/1183** 11 | -------------------------------------------------------------------------------- /create-snowpack-app/README.md: -------------------------------------------------------------------------------- 1 | ## 👉 [`create-snowpack-app`](./cli) 2 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-lit-element/snowpack.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const url = require('url'); 4 | 5 | const isTS = fs.existsSync(url.pathToFileURL(path.join(process.cwd(), 'tsconfig.json'))); 6 | 7 | module.exports = { 8 | mount: { 9 | public: {url: '/', static: true}, 10 | src: {url: '/dist'}, 11 | }, 12 | plugins: ['@snowpack/plugin-babel', '@snowpack/plugin-dotenv'], 13 | devOptions: {}, 14 | packageOptions: {}, 15 | }; 16 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-preact/babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-react", 5 | { 6 | "pragma": "h", 7 | "pragmaFrag": "Fragment" 8 | } 9 | ], 10 | [ 11 | "@babel/preset-typescript", 12 | { 13 | "jsxPragma": "h" 14 | } 15 | ] 16 | ], 17 | "env": { 18 | "development": { 19 | "plugins": ["@prefresh/babel-plugin"] 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-preact/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | // @remove-on-eject-begin 2 | /** 3 | * Copyright (c) 2014-present, Facebook, Inc. 4 | * 5 | * This source code is licensed under the MIT license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | // @remove-on-eject-end 9 | 'use strict'; 10 | 11 | // This is a custom Jest transformer turning style imports into empty objects. 12 | // http://facebook.github.io/jest/docs/en/webpack.html 13 | 14 | module.exports = { 15 | process() { 16 | return 'module.exports = {};'; 17 | }, 18 | getCacheKey() { 19 | // The output is always the same. 20 | return 'cssTransform'; 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-preact/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const path = require('path'); 3 | 4 | module.exports = { 5 | process(src, filename) { 6 | const assetFilename = path.basename(filename); 7 | return `module.exports = { 8 | __esModule: true, 9 | default: ${JSON.stringify(assetFilename)}, 10 | };`; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-preact/snowpack.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const cwd = process.cwd(); 5 | const isTS = fs.existsSync(path.join(cwd, 'tsconfig.json')); 6 | 7 | module.exports = { 8 | mount: { 9 | public: {url: '/', static: true}, 10 | src: {url: '/dist'}, 11 | }, 12 | plugins: ['@snowpack/plugin-babel', '@prefresh/snowpack', '@snowpack/plugin-dotenv'], 13 | packageOptions: {}, 14 | }; 15 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-react/babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-react"], "@babel/preset-typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-react/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | // @remove-on-eject-begin 2 | /** 3 | * Copyright (c) 2014-present, Facebook, Inc. 4 | * 5 | * This source code is licensed under the MIT license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | // @remove-on-eject-end 9 | 'use strict'; 10 | 11 | // This is a custom Jest transformer turning style imports into empty objects. 12 | // http://facebook.github.io/jest/docs/en/webpack.html 13 | 14 | module.exports = { 15 | process() { 16 | return 'module.exports = {};'; 17 | }, 18 | getCacheKey() { 19 | // The output is always the same. 20 | return 'cssTransform'; 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-react/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const path = require('path'); 3 | 4 | module.exports = { 5 | process(src, filename) { 6 | const assetFilename = path.basename(filename); 7 | return `module.exports = { 8 | __esModule: true, 9 | default: ${JSON.stringify(assetFilename)}, 10 | };`; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-react/snowpack.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const cwd = process.cwd(); 5 | const isTS = fs.existsSync(path.join(cwd, 'tsconfig.json')); 6 | 7 | module.exports = { 8 | mount: { 9 | public: {url: '/', static: true}, 10 | src: {url: '/dist'}, 11 | }, 12 | plugins: [ 13 | '@snowpack/plugin-react-refresh', 14 | '@snowpack/plugin-babel', 15 | '@snowpack/plugin-dotenv', 16 | ...(isTS ? ['@snowpack/plugin-typescript'] : []), 17 | ], 18 | devOptions: {}, 19 | packageOptions: {}, 20 | }; 21 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-svelte/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mount: { 3 | public: {url: '/', static: true}, 4 | src: {url: '/dist'}, 5 | }, 6 | plugins: ['@snowpack/plugin-svelte', '@snowpack/plugin-dotenv'], 7 | }; 8 | -------------------------------------------------------------------------------- /create-snowpack-app/app-scripts-vue/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mount: { 3 | public: {url: '/', static: true}, 4 | src: {url: '/dist'}, 5 | }, 6 | plugins: ['@snowpack/plugin-vue', '@snowpack/plugin-dotenv'], 7 | }; 8 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/.eleventy.js: -------------------------------------------------------------------------------- 1 | module.exports = function (eleventyConfig) { 2 | eleventyConfig.setTemplateFormats([ 3 | // Templates: 4 | 'html', 5 | 'njk', 6 | 'md', 7 | // Static Assets: 8 | 'css', 9 | 'jpeg', 10 | 'jpg', 11 | 'png', 12 | 'svg', 13 | 'woff', 14 | 'woff2', 15 | ]); 16 | eleventyConfig.addPassthroughCopy('static'); 17 | 18 | return { 19 | dir: { 20 | input: '_template', 21 | includes: '../_includes', 22 | output: '_output', 23 | }, 24 | }; 25 | }; 26 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/_output/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-11ty/_output/static/favicon.png -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/_output/static/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #222; 3 | color: #eee; 4 | font-family: Arial, Helvetica, sans-serif; 5 | text-align: center; 6 | } 7 | a { 8 | color: #aaa; 9 | } 10 | .banner { 11 | display: flex; 12 | justify-content: center; 13 | align-items: center; 14 | } 15 | .banner img, 16 | .banner svg { 17 | display: block; 18 | padding: 1.5rem; 19 | } 20 | 21 | #canvas { 22 | display: block; 23 | margin: 0rem auto; 24 | width: 720px; 25 | height: 420px; 26 | } 27 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/_template/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/base.njk 3 | --- 4 | 5 | # About 6 | 7 | [11ty](https://www.11ty.dev/), powered by [Snowpack](http://snowpack.dev/). 8 | 9 |
10 | 11 | [Back to Home](/) 12 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/_template/index.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layouts/base.njk 3 | --- 4 | 5 | 6 | 7 | About Page -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/_template/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-11ty/_template/static/favicon.png -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/_template/static/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #222; 3 | color: #eee; 4 | font-family: Arial, Helvetica, sans-serif; 5 | text-align: center; 6 | } 7 | a { 8 | color: #aaa; 9 | } 10 | .banner { 11 | display: flex; 12 | justify-content: center; 13 | align-items: center; 14 | } 15 | .banner img, 16 | .banner svg { 17 | display: block; 18 | padding: 1.5rem; 19 | } 20 | 21 | #canvas { 22 | display: block; 23 | margin: 0rem auto; 24 | width: 720px; 25 | height: 420px; 26 | } 27 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/_template/static/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-11ty/src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is just a silly example to show everything working in the browser. 3 | * When you're ready to start on your site, clear the file. Happy hacking! 4 | **/ 5 | 6 | import confetti from 'canvas-confetti'; 7 | 8 | confetti.create(document.getElementById('canvas'), { 9 | resize: true, 10 | useWorker: true, 11 | })({ particleCount: 200, spread: 200 }); 12 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank-typescript/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank-typescript/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank-typescript/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-blank-typescript/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank-typescript/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank-typescript/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: calc(10px + 2vmin); 3 | font-family: Arial, Helvetica, sans-serif; 4 | } 5 | 6 | #img { 7 | display: block; 8 | margin: auto; 9 | height: 128px; 10 | width: 128px; 11 | padding: 2rem; 12 | } 13 | 14 | p { 15 | display: block; 16 | margin: 1rem auto; 17 | text-align: center; 18 | } 19 | 20 | #counter { 21 | background-color: rgb(46, 94, 130); 22 | color: white; 23 | padding: 4px 8px; 24 | border-radius: 4px; 25 | } 26 | 27 | a { 28 | color: rgb(46, 94, 130); 29 | } 30 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank-typescript/src/index.ts: -------------------------------------------------------------------------------- 1 | const counter = document.querySelector('#counter') as HTMLSpanElement; 2 | let seconds = 0; 3 | 4 | setInterval(() => { 5 | seconds += 1; 6 | counter.textContent = seconds.toString(); 7 | }, 1000); 8 | 9 | export {}; 10 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank-typescript/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-blank/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank/snowpack.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import("snowpack").SnowpackUserConfig } */ 2 | export default { 3 | mount: { 4 | public: { url: '/', static: true }, 5 | src: { url: '/dist' }, 6 | }, 7 | plugins: [ 8 | /* ... */ 9 | ], 10 | routes: [ 11 | /* Enable an SPA Fallback in development: */ 12 | // {"match": "routes", "src": ".*", "dest": "/index.html"}, 13 | ], 14 | optimize: { 15 | /* Example: Bundle your final build: */ 16 | // "bundle": true, 17 | }, 18 | packageOptions: { 19 | /* ... */ 20 | }, 21 | devOptions: { 22 | /* ... */ 23 | }, 24 | buildOptions: { 25 | /* ... */ 26 | }, 27 | }; 28 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: calc(10px + 2vmin); 3 | font-family: Arial, Helvetica, sans-serif; 4 | } 5 | 6 | #img { 7 | display: block; 8 | margin: auto; 9 | height: 128px; 10 | width: 128px; 11 | padding: 2rem; 12 | } 13 | 14 | p { 15 | display: block; 16 | margin: 1rem auto; 17 | text-align: center; 18 | } 19 | 20 | #counter { 21 | background-color: rgb(46, 94, 130); 22 | color: white; 23 | padding: 4px 8px; 24 | border-radius: 4px; 25 | } 26 | 27 | a { 28 | color: rgb(46, 94, 130); 29 | } 30 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-blank/src/index.js: -------------------------------------------------------------------------------- 1 | const counter = document.querySelector('#counter'); 2 | let seconds = 0; 3 | 4 | setInterval(() => { 5 | seconds += 1; 6 | counter.textContent = seconds; 7 | }, 1000); 8 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element-typescript/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element-typescript/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element-typescript/babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-typescript"], 3 | "plugins": [ 4 | ["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }], 5 | ["@babel/plugin-proposal-class-properties", { "loose": true }] 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element-typescript/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-lit-element-typescript/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element-typescript/public/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; 3 | color: white; 4 | margin: 0; 5 | padding: 0; 6 | } 7 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element-typescript/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element-typescript/src/index.ts: -------------------------------------------------------------------------------- 1 | import './app-root'; 2 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element/babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | ["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }], 4 | ["@babel/plugin-proposal-class-properties", { "loose": true }] 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-lit-element/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element/public/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; 3 | color: white; 4 | margin: 0; 5 | padding: 0; 6 | } 7 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-lit-element/src/index.js: -------------------------------------------------------------------------------- 1 | import './app-root'; 2 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-minimal/index.css: -------------------------------------------------------------------------------- 1 | /* Add CSS styles here! */ 2 | body { 3 | font-family: sans-serif; 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-minimal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Starter Snowpack App 9 | 10 | 11 |

Welcome to Snowpack!

12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-minimal/index.js: -------------------------------------------------------------------------------- 1 | /* Add JavaScript code here! */ 2 | console.log('Hello World! You did it! Welcome to Snowpack :D'); 3 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-minimal/snowpack.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import("snowpack").SnowpackUserConfig } */ 2 | export default { 3 | mount: { 4 | /* ... */ 5 | }, 6 | plugins: [ 7 | /* ... */ 8 | ], 9 | routes: [ 10 | /* Enable an SPA Fallback in development: */ 11 | // {"match": "routes", "src": ".*", "dest": "/index.html"}, 12 | ], 13 | optimize: { 14 | /* Example: Bundle your final build: */ 15 | // "bundle": true, 16 | }, 17 | packageOptions: { 18 | /* ... */ 19 | }, 20 | devOptions: { 21 | /* ... */ 22 | }, 23 | buildOptions: { 24 | /* ... */ 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-preact-typescript/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import { h } from 'preact'; 2 | import { render } from '@testing-library/preact'; 3 | import { expect } from 'chai'; 4 | import App from './App'; 5 | 6 | describe('', () => { 7 | it('renders learn react link', () => { 8 | const { getByText } = render(); 9 | const linkElement = getByText(/learn preact/i); 10 | expect(document.body.contains(linkElement)); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { h, render } from 'preact'; 2 | import 'preact/devtools'; 3 | import App from './App.js'; 4 | import './index.css'; 5 | 6 | const root = document.getElementById('root') 7 | 8 | if (root) { 9 | render(, root); 10 | } 11 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/src/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-preact-typescript/src/logo.png -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact-typescript/web-test-runner.config.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = 'test'; 2 | 3 | module.exports = { 4 | plugins: [require('@snowpack/web-test-runner-plugin')()], 5 | }; 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-preact/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/src/App.test.jsx: -------------------------------------------------------------------------------- 1 | import { h } from 'preact'; 2 | import { render } from '@testing-library/preact'; 3 | import { expect } from 'chai'; 4 | import App from './App'; 5 | 6 | describe('', () => { 7 | it('renders learn react link', () => { 8 | const { getByText } = render(); 9 | const linkElement = getByText(/learn preact/i); 10 | expect(document.body.contains(linkElement)); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/src/index.jsx: -------------------------------------------------------------------------------- 1 | import { h, render } from 'preact'; 2 | import 'preact/devtools'; 3 | import App from './App.js'; 4 | import './index.css'; 5 | 6 | render(, document.getElementById('root')); 7 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/src/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-preact/src/logo.png -------------------------------------------------------------------------------- /create-snowpack-app/app-template-preact/web-test-runner.config.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = 'test'; 2 | 3 | module.exports = { 4 | plugins: [require('@snowpack/web-test-runner-plugin')()], 5 | }; 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-react-typescript/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import { expect } from 'chai'; 4 | import App from './App'; 5 | 6 | describe('', () => { 7 | it('renders learn react link', () => { 8 | const { getByText } = render(); 9 | const linkElement = getByText(/learn react/i); 10 | expect(document.body.contains(linkElement)); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import './index.css'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root'), 11 | ); 12 | 13 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 14 | // Learn more: https://snowpack.dev/concepts/hot-module-replacement 15 | if (import.meta.hot) { 16 | import.meta.hot.accept(); 17 | } 18 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react-typescript/web-test-runner.config.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = 'test'; 2 | 3 | module.exports = { 4 | plugins: [require('@snowpack/web-test-runner-plugin')()], 5 | }; 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-react/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/src/App.test.jsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import { expect } from 'chai'; 4 | import App from './App'; 5 | 6 | describe('', () => { 7 | it('renders learn react link', () => { 8 | const { getByText } = render(); 9 | const linkElement = getByText(/learn react/i); 10 | expect(document.body.contains(linkElement)); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/src/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App.jsx'; 4 | import './index.css'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root'), 11 | ); 12 | 13 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 14 | // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement 15 | if (import.meta.hot) { 16 | import.meta.hot.accept(); 17 | } 18 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-react/web-test-runner.config.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = 'test'; 2 | 3 | module.exports = { 4 | plugins: [require('@snowpack/web-test-runner-plugin')()], 5 | }; 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @snowpack/app-template-svelte-typescript 2 | 3 | ## 2.1.5 4 | 5 | ### Patch Changes 6 | 7 | - fed2c940: Remove default language option as its use is discouraged 8 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-svelte-typescript/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/src/App.test.ts: -------------------------------------------------------------------------------- 1 | import {render} from '@testing-library/svelte'; 2 | import {expect} from 'chai'; 3 | import App from './App.svelte'; 4 | 5 | describe('', () => { 6 | it('renders learn svelte link', () => { 7 | const {getByText} = render(App); 8 | const linkElement = getByText(/learn svelte/i); 9 | expect(document.body.contains(linkElement)); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/src/index.ts: -------------------------------------------------------------------------------- 1 | import App from './App.svelte'; 2 | 3 | var app = new App({ 4 | target: document.body, 5 | }); 6 | 7 | export default app; 8 | 9 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 10 | // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement 11 | if (import.meta.hot) { 12 | import.meta.hot.accept(); 13 | import.meta.hot.dispose(() => { 14 | app.$destroy(); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/svelte.config.js: -------------------------------------------------------------------------------- 1 | const autoPreprocess = require('svelte-preprocess'); 2 | 3 | module.exports = { 4 | preprocess: autoPreprocess(), 5 | }; 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte-typescript/web-test-runner.config.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = 'test'; 2 | 3 | module.exports = { 4 | plugins: [require('@snowpack/web-test-runner-plugin')()], 5 | }; 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-svelte/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte/src/App.test.js: -------------------------------------------------------------------------------- 1 | import {render} from '@testing-library/svelte'; 2 | import {expect} from 'chai'; 3 | import App from './App.svelte'; 4 | 5 | describe('', () => { 6 | it('renders learn svelte link', () => { 7 | const {getByText} = render(App); 8 | const linkElement = getByText(/learn svelte/i); 9 | expect(document.body.contains(linkElement)); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte/src/index.js: -------------------------------------------------------------------------------- 1 | import App from './App.svelte'; 2 | 3 | let app = new App({ 4 | target: document.body, 5 | }); 6 | 7 | export default app; 8 | 9 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 10 | // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement 11 | if (import.meta.hot) { 12 | import.meta.hot.accept(); 13 | import.meta.hot.dispose(() => { 14 | app.$destroy(); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-svelte/web-test-runner.config.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = 'test'; 2 | 3 | module.exports = { 4 | plugins: [require('@snowpack/web-test-runner-plugin')()], 5 | }; 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue-typescript/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue-typescript/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-vue-typescript/public/favicon-32x32.png -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue-typescript/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-vue-typescript/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue-typescript/public/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue-typescript/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue-typescript/src/index.js: -------------------------------------------------------------------------------- 1 | import {createApp} from 'vue'; 2 | import App from './App.vue'; 3 | 4 | const app = createApp(App); 5 | app.mount('#app'); 6 | 7 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 8 | // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement 9 | if (import.meta.hot) { 10 | import.meta.hot.accept(); 11 | import.meta.hot.dispose(() => { 12 | app.unmount(); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue-typescript/types/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import {defineComponent} from 'vue'; 3 | const component: ReturnType; 4 | export default component; 5 | } 6 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue/.npmignore: -------------------------------------------------------------------------------- 1 | .build 2 | build -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-vue/public/favicon-32x32.png -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/create-snowpack-app/app-template-vue/public/favicon.ico -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue/public/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue/snowpack.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import("snowpack").SnowpackUserConfig } */ 2 | export default { 3 | mount: { 4 | public: {url: '/', static: true}, 5 | src: {url: '/dist'}, 6 | }, 7 | plugins: ['@snowpack/plugin-vue', '@snowpack/plugin-dotenv'], 8 | routes: [ 9 | /* Enable an SPA Fallback in development: */ 10 | // {"match": "routes", "src": ".*", "dest": "/index.html"}, 11 | ], 12 | optimize: { 13 | /* Example: Bundle your final build: */ 14 | // "bundle": true, 15 | }, 16 | packageOptions: { 17 | /* ... */ 18 | }, 19 | devOptions: { 20 | /* ... */ 21 | }, 22 | buildOptions: { 23 | /* ... */ 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /create-snowpack-app/app-template-vue/src/index.js: -------------------------------------------------------------------------------- 1 | import {createApp} from 'vue'; 2 | import App from './App.vue'; 3 | 4 | const app = createApp(App); 5 | app.mount('#app'); 6 | 7 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 8 | // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement 9 | if (import.meta.hot) { 10 | import.meta.hot.accept(); 11 | import.meta.hot.dispose(() => { 12 | app.unmount(); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /create-snowpack-app/cli/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict'; 3 | 4 | const currentVersion = process.versions.node; 5 | const requiredMajorVersion = parseInt(currentVersion.split('.')[0], 10); 6 | const minimumMajorVersion = 10; 7 | 8 | if (requiredMajorVersion < minimumMajorVersion) { 9 | console.error(`Node.js v${currentVersion} is out of date and unsupported!`); 10 | console.error(`Please use Node.js v${minimumMajorVersion} or higher.`); 11 | process.exit(1); 12 | } 13 | 14 | require('./createSnowpackApp'); 15 | -------------------------------------------------------------------------------- /create-snowpack-app/cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-snowpack-app", 3 | "version": "1.10.0", 4 | "license": "MIT", 5 | "homepage": "https://github.com/withastro/snowpack/tree/main/create-snowpack-app/cli#readme", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/withastro/snowpack.git", 9 | "directory": "create-snowpack-app/cli" 10 | }, 11 | "publishConfig": { 12 | "access": "public" 13 | }, 14 | "bin": { 15 | "create-snowpack-app": "./index.js" 16 | }, 17 | "dependencies": { 18 | "execa": "^5.1.1", 19 | "fs-extra": "^9.0.0", 20 | "kleur": "^4.1.1", 21 | "yargs-parser": "^20.0.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 |

Documentation

2 | 3 | **📚 To read our documentation, please visit the official [Snowpack website ➞](https://snowpack.dev)** 4 | 5 | --- 6 | 7 | **🙋 To contribute to our documentation, please read our [Contributor Guidelines ➞](../CONTRIBUTING.md#Documentation)** 8 | -------------------------------------------------------------------------------- /esinstall/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | -------------------------------------------------------------------------------- /esinstall/index.esm.mjs: -------------------------------------------------------------------------------- 1 | import Pkg from './lib/index.js'; 2 | 3 | export const printStats = Pkg.printStats; 4 | export const install = Pkg.install; 5 | -------------------------------------------------------------------------------- /esinstall/src/rollup-plugins/rollup-plugin-strip-source-mapping.ts: -------------------------------------------------------------------------------- 1 | import {Plugin} from 'rollup'; 2 | 3 | /** 4 | * rollup-plugin-strip-source-mapping 5 | * 6 | * Remove any lingering source map comments 7 | */ 8 | export function rollupPluginStripSourceMapping(): Plugin { 9 | return { 10 | name: 'snowpack:rollup-plugin-strip-source-mapping', 11 | transform: (code) => ({ 12 | code: code 13 | // [a-zA-Z0-9-_\*?\.\/\&=+%]: valid URL characters (for sourcemaps) 14 | .replace(/\/\/#\s*sourceMappingURL=[a-zA-Z0-9-_\*\?\.\/\&=+%\s]+$/gm, ''), 15 | map: null, 16 | }), 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /esinstall/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["src"], 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "module": "commonjs", 6 | "target": "es2018", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "esModuleInterop": true, 10 | "strict": true, 11 | "sourceMap": true, 12 | "noImplicitAny": false, 13 | "noUnusedLocals": true, 14 | "noUnusedParameters": true, 15 | "skipLibCheck": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | yarn.lock 2 | -------------------------------------------------------------------------------- /examples/https-ssl-certificates/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "snowpack": "^3.0.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/https-ssl-certificates/snowpack.config.js: -------------------------------------------------------------------------------- 1 | // Snowpack Configuration File 2 | // See all supported options: https://www.snowpack.dev/reference/configuration 3 | 4 | /** @type {import("snowpack").SnowpackUserConfig } */ 5 | module.exports = { 6 | mount: { 7 | /* ... */ 8 | }, 9 | plugins: [ 10 | /* ... */ 11 | ], 12 | packageOptions: { 13 | /* ... */ 14 | }, 15 | devOptions: { 16 | /* ... */ 17 | }, 18 | buildOptions: { 19 | /* ... */ 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /examples/react-global-imports/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@babel/preset-react'], 3 | plugins: [ 4 | [ 5 | 'import-globals', 6 | { 7 | React: 'react', 8 | Component: {moduleName: 'react', exportName: 'Component'}, 9 | PropTypes: {moduleName: 'react', exportName: 'PropTypes'}, 10 | ReactDOM: 'react-dom', 11 | }, 12 | ], 13 | ], 14 | }; 15 | -------------------------------------------------------------------------------- /examples/react-global-imports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/example-react-global-imports", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "snowpack dev", 7 | "build": "snowpack build" 8 | }, 9 | "dependencies": { 10 | "react": "^17.0.0", 11 | "react-dom": "^17.0.0" 12 | }, 13 | "devDependencies": { 14 | "@babel/preset-react": "^7.12.7", 15 | "@snowpack/plugin-babel": "^2.1.4", 16 | "@snowpack/plugin-dotenv": "^2.0.4", 17 | "@snowpack/plugin-react-refresh": "^2.3.7", 18 | "babel-plugin-import-globals": "^2.0.0", 19 | "snowpack": "^3.0.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/react-global-imports/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/examples/react-global-imports/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-global-imports/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/react-global-imports/snowpack.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import("snowpack").SnowpackUserConfig } */ 2 | module.exports = { 3 | mount: { 4 | public: '/', 5 | src: '/dist', 6 | }, 7 | plugins: ['@snowpack/plugin-babel', '@snowpack/plugin-react-refresh', '@snowpack/plugin-dotenv'], 8 | packageOptions: { 9 | knownEntrypoints: ['react', 'react-dom'], 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /examples/react-global-imports/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /examples/react-global-imports/src/index.jsx: -------------------------------------------------------------------------------- 1 | import App from './App.jsx'; 2 | import './index.css'; 3 | 4 | ReactDOM.render( 5 | 6 | 7 | , 8 | document.getElementById('root'), 9 | ); 10 | 11 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 12 | // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement 13 | if (import.meta.hot) { 14 | import.meta.hot.accept(); 15 | } 16 | -------------------------------------------------------------------------------- /examples/react-loadable-components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/example-react-loadable-components", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "snowpack dev", 7 | "build": "snowpack build" 8 | }, 9 | "dependencies": { 10 | "react": "^17.0.0", 11 | "react-dom": "^17.0.0" 12 | }, 13 | "devDependencies": { 14 | "@snowpack/plugin-dotenv": "^2.0.4", 15 | "@snowpack/plugin-react-refresh": "^2.3.7", 16 | "snowpack": "^3.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/react-loadable-components/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/examples/react-loadable-components/public/favicon.ico -------------------------------------------------------------------------------- /examples/react-loadable-components/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/react-loadable-components/snowpack.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import("snowpack").SnowpackUserConfig } */ 2 | module.exports = { 3 | mount: { 4 | public: '/', 5 | src: '/dist', 6 | }, 7 | plugins: ['@snowpack/plugin-react-refresh', '@snowpack/plugin-dotenv'], 8 | }; 9 | -------------------------------------------------------------------------------- /examples/react-loadable-components/src/Async.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | function Async() { 4 | return
I‘m an Async Component!
; 5 | } 6 | 7 | export default Async; 8 | -------------------------------------------------------------------------------- /examples/react-loadable-components/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /examples/react-loadable-components/src/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App.jsx'; 4 | import './index.css'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root'), 11 | ); 12 | 13 | // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. 14 | // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement 15 | if (import.meta.hot) { 16 | import.meta.hot.accept(); 17 | } 18 | -------------------------------------------------------------------------------- /examples/tailwind/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: ../../main.njk 3 | title: Tailwind 4 | --- 5 | 6 | ### Learn more 7 | 8 | - [Tailwind docs on Snowpack][tailwind] 9 | 10 | [tailwind]: https://www.snowpack.dev/guides/tailwind-css/ 11 | -------------------------------------------------------------------------------- /examples/tailwind/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/example-react-loadable-components", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "snowpack dev", 7 | "build": "snowpack build" 8 | }, 9 | "devDependencies": { 10 | "@snowpack/plugin-postcss": "^1.3.0", 11 | "postcss": "^8.3.5", 12 | "snowpack": "^3.4.0", 13 | "tailwindcss": "^2.1.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/tailwind/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | // other plugins can go here, such as autoprefixer 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /examples/tailwind/public/global.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /examples/tailwind/snowpack.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import("snowpack").SnowpackUserConfig } */ 2 | export default { 3 | mount: { 4 | public: '/', 5 | src: '/_dist', 6 | }, 7 | devOptions: { 8 | tailwindConfig: './tailwind.config.js', 9 | }, 10 | plugins: ['@snowpack/plugin-postcss'], 11 | }; 12 | -------------------------------------------------------------------------------- /examples/tailwind/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: 'jit', 3 | purge: ['./public/**/*.html', './src/**/*.{js,jsx,ts,tsx,vue}'], 4 | // specify other options here 5 | }; 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | modulePathIgnorePatterns: [ 3 | '/create-snowpack-app/app-template-', // don’t run tests intended as user examples 4 | '/examples', // don’t run any tests in examples 5 | '/test/create-snowpack-app/test-install', // don’t run tests inside our mock create-snowpack-app install 6 | '/www', // docs has its own tests 7 | ], 8 | globalSetup: '/jest.setup.js', 9 | testEnvironment: 'node', 10 | }; 11 | -------------------------------------------------------------------------------- /jest.setup.js: -------------------------------------------------------------------------------- 1 | module.exports = async () => { 2 | // enable NO_COLOR mode for Jest 3 | process.env.NO_COLOR = true; 4 | // Clear the temp directory 5 | const path = require('path'); 6 | const rimraf = require('rimraf'); 7 | const fs = require('fs'); 8 | rimraf.sync(path.join(__dirname, 'test', '__temp__')); 9 | fs.mkdirSync(path.join(__dirname, 'test', '__temp__')); 10 | }; -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "independent", 3 | "packages": ["snowpack", "skypack", "esinstall", "create-snowpack-app/*", "plugins/*"], 4 | "npmClient": "yarn", 5 | "useWorkspaces": true 6 | } 7 | -------------------------------------------------------------------------------- /plugins/plugin-babel/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @snowpack/plugin-babel 2 | 3 | ## 2.1.7 4 | 5 | ### Patch Changes 6 | 7 | - b34b011a: update babel plugin to support process.env packages 8 | - ecd6ce07: Fix undefined accessor errors using @snowpack/plugin-babel with snowpack 3.1.x (#3000) 9 | - 48ced185: Update plugin-babel readme (#2574) 10 | 11 | _For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-babel)._ 12 | -------------------------------------------------------------------------------- /plugins/plugin-babel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/plugin-babel", 3 | "version": "2.1.7", 4 | "main": "plugin.js", 5 | "license": "MIT", 6 | "homepage": "https://github.com/withastro/snowpack/tree/main/plugins/plugin-babel#readme", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/snowpack.git", 10 | "directory": "plugins/plugin-babel" 11 | }, 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "dependencies": { 16 | "@babel/core": "^7.14.0", 17 | "workerpool": "^6.0.0" 18 | }, 19 | "gitHead": "a01616bb0787d56cd782f94cecf2daa12c7594e4" 20 | } 21 | -------------------------------------------------------------------------------- /plugins/plugin-babel/worker.js: -------------------------------------------------------------------------------- 1 | const workerpool = require('workerpool'); 2 | const babel = require('@babel/core'); 3 | 4 | async function transformFileAsync(path, options) { 5 | const {code, map} = await babel.transformFileAsync(path, options); 6 | return JSON.stringify({code, map}); 7 | } 8 | 9 | // create a worker and register public functions 10 | workerpool.worker({ 11 | transformFileAsync, 12 | }); 13 | -------------------------------------------------------------------------------- /plugins/plugin-build-script/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.1.0", 3 | "name": "@snowpack/plugin-build-script", 4 | "main": "plugin.js", 5 | "license": "MIT", 6 | "homepage": "https://github.com/withastro/snowpack/tree/main/plugins/plugin-build-script#readme", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/snowpack.git", 10 | "directory": "plugins/plugin-build-script" 11 | }, 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "dependencies": { 16 | "execa": "^5.1.1", 17 | "npm-run-path": "^4.0.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @snowpack/plugin-dotenv 2 | 3 | ## 2.2.0 4 | 5 | ### Minor Changes 6 | 7 | - cf1bd442: Added an option to disable dotenv-expand functionality 8 | 9 | ## 2.1.0 10 | 11 | ### Minor Changes 12 | 13 | - 38031e7e: Add options to plugin-dotenv (#2917) 14 | 15 | ### Patch Changes 16 | 17 | - ad8de420: [ci] yarn format 18 | - ae4c04bd: Updated link; reference page had moved (#2646) 19 | 20 | _For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-dotenv)._ 21 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/plugin-dotenv", 3 | "version": "2.2.0", 4 | "main": "plugin.js", 5 | "license": "MIT", 6 | "homepage": "https://github.com/withastro/snowpack/tree/main/plugins/plugin-dotenv#readme", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/snowpack.git", 10 | "directory": "plugins/plugin-dotenv" 11 | }, 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "dependencies": { 16 | "dotenv": "^8.2.0", 17 | "dotenv-expand": "^5.1.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=ENV 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_DEVELOPMENT_LOCAL=ENV 6 | __DOTENV_TEST_LOCAL=ENV 7 | __DOTENV_PRODUCTION_LOCAL=ENV 8 | 9 | # don't cover `.env.local` 10 | __DOTENV_LOCAL=ENV 11 | 12 | # don't cover `.env.${NODE_ENV}` 13 | __DOTENV_DEVELOPMENT=ENV 14 | __DOTENV_TEST=ENV 15 | __DOTENV_PRODUCTION=ENV 16 | 17 | # new environment variable 18 | __DOTENV_ENV=ENV 19 | 20 | # expanded variable 21 | __DOTENV_EXPAND=${__DOTENV_PRESET} 22 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env.development: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=DEVELOPMENT 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_DEVELOPMENT_LOCAL=DEVELOPMENT 6 | 7 | # don't cover `.env.local` 8 | __DOTENV_LOCAL=DEVELOPMENT 9 | 10 | # new environment variable 11 | __DOTENV_DEVELOPMENT=DEVELOPMENT 12 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env.development.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=DEVELOPMENT_LOCAL 3 | 4 | # new environment variable 5 | __DOTENV_DEVELOPMENT_LOCAL=DEVELOPMENT_LOCAL 6 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=LOCAL 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_DEVELOPMENT_LOCAL=LOCAL 6 | __DOTENV_TEST_LOCAL=LOCAL 7 | __DOTENV_PRODUCTION_LOCAL=LOCAL 8 | 9 | # new environment variable 10 | __DOTENV_LOCAL=LOCAL 11 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env.production: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=PRODUCTION 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_PRODUCTION_LOCAL=PRODUCTION 6 | 7 | # don't cover `.env.local` 8 | __DOTENV_LOCAL=PRODUCTION 9 | 10 | # new environment variable 11 | __DOTENV_PRODUCTION=PRODUCTION 12 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env.production.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=PRODUCTION_LOCAL 3 | 4 | # new environment variable 5 | __DOTENV_PRODUCTION_LOCAL=PRODUCTION_LOCAL 6 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env.test: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=TEST 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_TEST_LOCAL=TEST 6 | 7 | # new environment variable since 8 | # the plugin doesn't handle `.env.local` file when NODE_ENV=test 9 | __DOTENV_LOCAL=TEST 10 | 11 | # new environment variable 12 | __DOTENV_TEST=TEST 13 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/.env.test.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=TEST_LOCAL 3 | 4 | # new environment variable 5 | __DOTENV_TEST_LOCAL=TEST_LOCAL 6 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=ENV 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_DEVELOPMENT_LOCAL=ENV 6 | __DOTENV_TEST_LOCAL=ENV 7 | __DOTENV_PRODUCTION_LOCAL=ENV 8 | 9 | # don't cover `.env.local` 10 | __DOTENV_LOCAL=ENV 11 | 12 | # don't cover `.env.${NODE_ENV}` 13 | __DOTENV_DEVELOPMENT=ENV 14 | __DOTENV_TEST=ENV 15 | __DOTENV_PRODUCTION=ENV 16 | 17 | # new environment variable 18 | __DOTENV_ENV=ENV 19 | 20 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env.development: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=DEVELOPMENT 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_DEVELOPMENT_LOCAL=DEVELOPMENT 6 | 7 | # don't cover `.env.local` 8 | __DOTENV_LOCAL=DEVELOPMENT 9 | 10 | # new environment variable 11 | __DOTENV_DEVELOPMENT=DEVELOPMENT 12 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env.development.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=DEVELOPMENT_LOCAL 3 | 4 | # new environment variable 5 | __DOTENV_DEVELOPMENT_LOCAL=DEVELOPMENT_LOCAL 6 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=LOCAL 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_DEVELOPMENT_LOCAL=LOCAL 6 | __DOTENV_TEST_LOCAL=LOCAL 7 | __DOTENV_PRODUCTION_LOCAL=LOCAL 8 | 9 | # new environment variable 10 | __DOTENV_LOCAL=LOCAL 11 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env.production: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=PRODUCTION 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_PRODUCTION_LOCAL=PRODUCTION 6 | 7 | # don't cover `.env.local` 8 | __DOTENV_LOCAL=PRODUCTION 9 | 10 | # new environment variable 11 | __DOTENV_PRODUCTION=PRODUCTION 12 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env.production.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=PRODUCTION_LOCAL 3 | 4 | # new environment variable 5 | __DOTENV_PRODUCTION_LOCAL=PRODUCTION_LOCAL 6 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env.test: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=TEST 3 | 4 | # don't cover `.env.${NODE_ENV}.local` 5 | __DOTENV_TEST_LOCAL=TEST 6 | 7 | # new environment variable since 8 | # the plugin doesn't handle `.env.local` file when NODE_ENV=test 9 | __DOTENV_LOCAL=TEST 10 | 11 | # new environment variable 12 | __DOTENV_TEST=TEST 13 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/env/subdir/.env.test.local: -------------------------------------------------------------------------------- 1 | # don't cover preset 2 | __DOTENV_PRESET=TEST_LOCAL 3 | 4 | # new environment variable 5 | __DOTENV_TEST_LOCAL=TEST_LOCAL 6 | -------------------------------------------------------------------------------- /plugins/plugin-dotenv/test/execPlugin.js: -------------------------------------------------------------------------------- 1 | const dotenvPlugin = require('../plugin'); 2 | const params = JSON.parse(process.argv[2]); 3 | 4 | dotenvPlugin(null, params); 5 | 6 | const testEnvs = Object.keys(process.env) 7 | .filter((key) => key.startsWith('__DOTENV_')) 8 | .reduce((ret, curr) => { 9 | ret[curr] = process.env[curr]; 10 | return ret; 11 | }, {}); 12 | 13 | console.log(JSON.stringify(testEnvs)); 14 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/do-not-preload-1.js: -------------------------------------------------------------------------------- 1 | console.error('Error: this file in a comment shouldn’t be preloaded'); 2 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/do-not-preload-2.js: -------------------------------------------------------------------------------- 1 | console.error('Error: this entry file shouldn’t be preloaded, either (it’s already in the entry)'); 2 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/do-not-preload-3.js: -------------------------------------------------------------------------------- 1 | console.error('Error: this lazy-loaded file should not be preloaded (then it’s not lazy-loaded)'); 2 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/esm_example.js: -------------------------------------------------------------------------------- 1 | export default function esm_example() { 2 | console.log('example'); 3 | return 1; 4 | } 5 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Minimal test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/index.js: -------------------------------------------------------------------------------- 1 | import esm_example from './esm_example.js'; 2 | import supportTarget from './target-es2018.js'; 3 | import('./do-not-preload-3.js'); 4 | 5 | (() => { 6 | function n(o) { 7 | console.log(o); 8 | } 9 | n('test', supportTarget()); 10 | })(); 11 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-webpack-test-minimal", 3 | "main": "src/index.js" 4 | } 5 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | border: 1px solid #ffffff; 3 | margin: 1px 1px 1px 1px; 4 | } 5 | -------------------------------------------------------------------------------- /plugins/plugin-optimize/test/stubs/minimal/target-es2018.js: -------------------------------------------------------------------------------- 1 | export default function testTarget() { 2 | // es2020 - Optional Chaining & Nullish coalescing Operator 3 | const foo = { 4 | bar: 'bar', 5 | }; 6 | const bar = null; 7 | console.log(foo?.bar, bar ?? 100); 8 | return true; 9 | } 10 | -------------------------------------------------------------------------------- /plugins/plugin-postcss/test/fixtures/from/from.css: -------------------------------------------------------------------------------- 1 | @from(.foo) { 2 | 3 | } -------------------------------------------------------------------------------- /plugins/plugin-postcss/test/fixtures/from/postcss.config.js: -------------------------------------------------------------------------------- 1 | function pluginFrom() { 2 | return { 3 | postcssPlugin: 'plugin-from', 4 | AtRule(node, {result, Declaration}) { 5 | node.replaceWith(new Declaration({prop: 'content', value: `"${result.opts.from}"`})); 6 | }, 7 | }; 8 | } 9 | 10 | pluginFrom.postcss = true; 11 | 12 | module.exports = { 13 | plugins: [pluginFrom], 14 | }; 15 | -------------------------------------------------------------------------------- /plugins/plugin-postcss/test/fixtures/from/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #fff; 3 | } 4 | 5 | #root { 6 | width: 480px; 7 | margin: auto; 8 | padding: 16px; 9 | box-sizing: border-box; 10 | } 11 | 12 | .content { 13 | color: blue; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /plugins/plugin-postcss/test/fixtures/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('cssnano')({ 4 | preset: 'default', 5 | }), 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /plugins/plugin-postcss/test/fixtures/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #fff; 3 | } 4 | 5 | #root { 6 | box-sizing: border-box; 7 | margin: auto; 8 | padding: 16px; 9 | width: 480px; 10 | } 11 | 12 | .content { 13 | color: blue; 14 | } 15 | -------------------------------------------------------------------------------- /plugins/plugin-postcss/test/fixtures/style.min.css: -------------------------------------------------------------------------------- 1 | body{background:#fff}#root{box-sizing:border-box;margin:auto;padding:16px;width:480px}.content{color:blue} -------------------------------------------------------------------------------- /plugins/plugin-react-refresh/test/stubs/stub.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /plugins/plugin-react-refresh/test/stubs/stub.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | function App() { 3 | return /* @__PURE__ */ React.createElement('div', null, 'React App'); 4 | } 5 | export default App; 6 | -------------------------------------------------------------------------------- /plugins/plugin-run-script/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.3.0", 3 | "name": "@snowpack/plugin-run-script", 4 | "main": "plugin.js", 5 | "license": "MIT", 6 | "homepage": "https://github.com/withastro/snowpack/tree/main/plugins/plugin-run-script#readme", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/snowpack.git", 10 | "directory": "plugins/plugin-run-script" 11 | }, 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "dependencies": { 16 | "execa": "^5.1.1", 17 | "npm-run-path": "^4.0.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugins/plugin-sass/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.4.0", 3 | "name": "@snowpack/plugin-sass", 4 | "main": "plugin.js", 5 | "license": "MIT", 6 | "homepage": "https://github.com/withastro/snowpack/tree/main/plugins/plugin-sass#readme", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/snowpack.git", 10 | "directory": "plugins/plugin-sass" 11 | }, 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "dependencies": { 16 | "execa": "^5.1.1", 17 | "find-up": "^5.0.0", 18 | "npm-run-path": "^4.0.1", 19 | "sass": "^1.3.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /plugins/plugin-sass/test/__snapshots__/plugin.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`plugin-sass returns the compiled Sass result: App.sass 1`] = ` 4 | ".child { 5 | text-align: left; 6 | } 7 | 8 | body { 9 | font-family: Helvetica, sans-serif; 10 | } 11 | 12 | .App { 13 | text-align: center; 14 | background: #333; 15 | }" 16 | `; 17 | 18 | exports[`plugin-sass returns the compiled Sass result: App.scss 1`] = ` 19 | "body { 20 | font-family: Helvetica, sans-serif; 21 | } 22 | 23 | .App { 24 | text-align: center; 25 | background: #333; 26 | }" 27 | `; 28 | -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/bad/bad.scss: -------------------------------------------------------------------------------- 1 | awegagwagawingawignTHISISBADCODE -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/sass/App.sass: -------------------------------------------------------------------------------- 1 | @use 'base' 2 | @use 'folder' 3 | 4 | body 5 | font-family: folder.$font-stack 6 | 7 | .App 8 | text-align: center 9 | background: base.$primary-color 10 | -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/sass/_base.sass: -------------------------------------------------------------------------------- 1 | // _base.scss 2 | $primary-color: #333 3 | -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/sass/folder/_child-partial.sass: -------------------------------------------------------------------------------- 1 | .child 2 | text-align: left 3 | -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/sass/folder/_index.sass: -------------------------------------------------------------------------------- 1 | // folder/_index.sass 2 | @use 'child-partial' 3 | 4 | $font-stack: Helvetica, sans-serif 5 | -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/scss/App.scss: -------------------------------------------------------------------------------- 1 | @use 'base'; 2 | @use 'folder'; 3 | 4 | 5 | body { 6 | font-family: folder.$font-stack; 7 | } 8 | 9 | .App { 10 | text-align: center; 11 | background: base.$primary-color; 12 | } -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/scss/_base.scss: -------------------------------------------------------------------------------- 1 | // _base.scss 2 | $primary-color: #333; 3 | -------------------------------------------------------------------------------- /plugins/plugin-sass/test/fixtures/scss/folder/_index.scss: -------------------------------------------------------------------------------- 1 | // folder/_index.scss 2 | $font-stack: Helvetica, sans-serif; 3 | -------------------------------------------------------------------------------- /plugins/plugin-svelte/test/Button.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/plugin-svelte/test/custom-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preprocess: { 3 | __test: 'custom-config.js::preprocess', 4 | }, 5 | compilerOptions: { 6 | __test: 'custom-config.js', 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /plugins/plugin-svelte/test/svelte.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preprocess: { 3 | __test: 'svelte.config.js::preprocess', 4 | }, 5 | compilerOptions: { 6 | __test: 'svelte.config.js', 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /plugins/plugin-typescript/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @snowpack/plugin-typescript 2 | 3 | ## 1.2.1 4 | 5 | ### Patch Changes 6 | 7 | - f8f32551: [ci] yarn format 8 | - 6b105339: add esinstall missing import hint (#2299) 9 | 10 | _For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-typescript)._ 11 | -------------------------------------------------------------------------------- /plugins/plugin-typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.1", 3 | "name": "@snowpack/plugin-typescript", 4 | "main": "plugin.js", 5 | "license": "MIT", 6 | "homepage": "https://github.com/withastro/snowpack/tree/main/plugins/plugin-typescript#readme", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/snowpack.git", 10 | "directory": "plugins/plugin-typescript" 11 | }, 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "peerDependencies": { 16 | "typescript": "*" 17 | }, 18 | "dependencies": { 19 | "execa": "^5.1.1", 20 | "npm-run-path": "^4.0.1" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /plugins/plugin-vue/plugin-tsx-jsx.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const scriptCompilers = require('./src/script-compilers'); 3 | 4 | module.exports = function plugin(snowpackConfig, pluginOptions) { 5 | return { 6 | name: '@snowpack/plugin-vue-tsx-jsx', 7 | resolve: { 8 | input: ['.tsx', '.jsx'], 9 | output: ['.js'], 10 | }, 11 | async load({filePath, fileExt}) { 12 | const content = fs.readFileSync(filePath, 'utf-8'); 13 | const lang = fileExt.slice(fileExt.lastIndexOf('.') + 1); 14 | const result = scriptCompilers.esbuildCompile(content, lang); 15 | return result; 16 | }, 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/JsxContent.jsx: -------------------------------------------------------------------------------- 1 | import {defineComponent} from 'vue'; 2 | 3 | export default defineComponent({ 4 | name: 'JsxContent', 5 | setup() { 6 | return () => ( 7 | <> 8 |

JsxContent

9 | 10 | ); 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/TsContent.ts: -------------------------------------------------------------------------------- 1 | import {defineComponent} from 'vue'; 2 | 3 | export default defineComponent({ 4 | name: 'TsContent', 5 | setup() { 6 | const name: string = 'TsContent'; 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/TsxContent.tsx: -------------------------------------------------------------------------------- 1 | import {defineComponent} from 'vue'; 2 | 3 | export default defineComponent({ 4 | name: 'TsxContent', 5 | setup() { 6 | const name: string = 'TsxContent'; 7 | return () => ( 8 | <> 9 |

TsxContent

10 | 11 | ); 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/VueContentJsx.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/VueContentOnlyTpl.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/VueContentStyleScoped.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/VueContentTs.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/VueContentTsx.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/plugin-vue/test/stubs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "preserve", 4 | "jsxFactory": "h", 5 | "jsxFragmentFactory": "Fragment" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/.gitignore: -------------------------------------------------------------------------------- 1 | test/stubs/*_ignore/ 2 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/plugins/proxy-import-resolve.js: -------------------------------------------------------------------------------- 1 | module.exports = function proxyImportResolver(source) { 2 | return source.replace( 3 | /(?:import|from)\s*['"].*\.(\w+)\.proxy\.js['"]/g, 4 | (fullMatch, originalExt) => { 5 | return fullMatch.replace('.proxy.js', ''); 6 | }, 7 | ); 8 | }; 9 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/minimal/backpack.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/minimal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Minimal test 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/minimal/index.js: -------------------------------------------------------------------------------- 1 | import './styles.css'; 2 | import './backpack.svg'; 3 | console.log('test'); 4 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/minimal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-webpack-test-minimal", 3 | "main": "src/index.js" 4 | } 5 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/minimal/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: skyblue; 3 | } 4 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/multiple-entrypoints/admin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Multiple entrypoints test - /admin 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/multiple-entrypoints/admin/index.js: -------------------------------------------------------------------------------- 1 | console.log('admin test'); 2 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/multiple-entrypoints/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Multiple entrypoints test - root 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/multiple-entrypoints/index.js: -------------------------------------------------------------------------------- 1 | console.log('root test'); 2 | -------------------------------------------------------------------------------- /plugins/plugin-webpack/test/stubs/multiple-entrypoints/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-webpack-test-minimal", 3 | "main": "src/index.js" 4 | } 5 | -------------------------------------------------------------------------------- /skypack/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib -------------------------------------------------------------------------------- /skypack/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "bracketSpacing": false, 5 | "printWidth": 100 6 | } 7 | -------------------------------------------------------------------------------- /skypack/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # skypack 2 | 3 | ## 0.3.3 4 | 5 | ### Patch Changes 6 | 7 | - 5e84cdd8: Fixes a ghost dependency on 'tar' 8 | 9 | ## 0.3.2 10 | 11 | ### Patch Changes 12 | 13 | - b5e49467: update changelogs 14 | - bf220191: [ci] yarn format 15 | 16 | ## 0.3.1 17 | 18 | ### Patch Changes 19 | 20 | - 59ee847e: cleanup broken skypack sdk references 21 | -------------------------------------------------------------------------------- /skypack/README.md: -------------------------------------------------------------------------------- 1 | # Skypack 2 | 3 | This is an experimental SDK for interacting with the Skypack Package CDN. It is not yet ready for public use, and may change without notice. Use at your own risk! 4 | 5 | More documentation will be written as this gets closer to a public release! Until then, you can browse the package code to get a better idea of the interface. 6 | 7 | ``` 8 | npm install skypack 9 | ``` 10 | -------------------------------------------------------------------------------- /skypack/index.esm.mjs: -------------------------------------------------------------------------------- 1 | import Pkg from './lib/index.js'; 2 | 3 | export const rollupPluginSkypack = Pkg.rollupPluginSkypack; 4 | export const generateImportMap = Pkg.generateImportMap; 5 | export const fetchCDN = Pkg.fetchCDN; 6 | export const buildNewPackage = Pkg.buildNewPackage; 7 | export const lookupBySpecifier = Pkg.lookupBySpecifier; 8 | export const clearCache = Pkg.clearCache; 9 | export const SKYPACK_ORIGIN = Pkg.SKYPACK_ORIGIN; 10 | -------------------------------------------------------------------------------- /skypack/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["src"], 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "module": "commonjs", 6 | "target": "es2018", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "esModuleInterop": true, 10 | "strict": true, 11 | "sourceMap": true, 12 | "noImplicitAny": false, 13 | "noUnusedLocals": true, 14 | "noUnusedParameters": true, 15 | "skipLibCheck": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /snowpack/.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules 3 | vendor/generated/ 4 | vendor/types/ 5 | -------------------------------------------------------------------------------- /snowpack/.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | 3 | -------------------------------------------------------------------------------- /snowpack/assets/snowpack-init-file.js: -------------------------------------------------------------------------------- 1 | // Snowpack Configuration File 2 | // See all supported options: https://www.snowpack.dev/reference/configuration 3 | 4 | /** @type {import("snowpack").SnowpackUserConfig } */ 5 | module.exports = { 6 | mount: { 7 | /* ... */ 8 | }, 9 | plugins: [ 10 | /* ... */ 11 | ], 12 | packageOptions: { 13 | /* ... */ 14 | }, 15 | devOptions: { 16 | /* ... */ 17 | }, 18 | buildOptions: { 19 | /* ... */ 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /snowpack/index.bin.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict'; 3 | 4 | const ver = process.versions.node; 5 | const majorVer = parseInt(ver.split('.')[0], 10); 6 | 7 | if (majorVer < 10) { 8 | console.error('Node version ' + ver + ' is not supported, please use Node.js 10.0 or higher.'); 9 | process.exit(1); 10 | } 11 | 12 | const cli = require('./lib/cjs/index.js'); 13 | const run = cli.run || cli.cli || cli.default; 14 | run(process.argv).catch(function (error) { 15 | console.error(` 16 | ${error.stack || error.message || error} 17 | `); 18 | process.exit(1); 19 | }); 20 | -------------------------------------------------------------------------------- /snowpack/src/build/import-sri.ts: -------------------------------------------------------------------------------- 1 | import {createHash} from 'crypto'; 2 | 3 | type SupportedSRIAlgorithm = 'sha512' | 'sha384' | 'sha256'; 4 | const DEFAULT_CRYPTO_HASH = 'sha384'; 5 | const EMPTY_BUFFER = Buffer.from(''); 6 | 7 | export const generateSRI = ( 8 | buffer: Buffer = EMPTY_BUFFER, 9 | hashAlgorithm: SupportedSRIAlgorithm = DEFAULT_CRYPTO_HASH, 10 | ) => `${hashAlgorithm}-${createHash(hashAlgorithm).update(buffer).digest('base64')}`; 11 | -------------------------------------------------------------------------------- /snowpack/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "module": "CommonJS", 6 | "outDir": "lib/cjs" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /snowpack/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["src", "assets/require-or-import.ts"], 3 | "exclude": ["lib"], 4 | "compilerOptions": { 5 | "outDir": "lib/esm", 6 | "module": "ESNext", 7 | "target": "es2018", 8 | "moduleResolution": "node", 9 | "declaration": true, 10 | "esModuleInterop": true, 11 | "strict": true, 12 | "sourceMap": false, 13 | "noImplicitAny": false, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "skipLibCheck": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test-dev/README.md: -------------------------------------------------------------------------------- 1 | # Tests for `snowpack dev` 2 | 3 | We moved the tests out of the common `test/` folder because of problems with Windows. This way, we can run the dev tests using a separate command, which we can run on CI on Ubuntu only. 4 | 5 | We would love to figure out the problem. If you develop on a Windows machine, we would appreciate your help. See [#1171](https://github.com/withastro/snowpack/pull/1171) for more information. 6 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@snowpack/plugin-build-script": "^2.0.7", 4 | "canvas-confetti": "^1.2.0", 5 | "snowpack": "^3.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-1/public/about.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

this is a template in some language that builds to .html

6 | 7 | 8 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-1/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/test-dev/smoke-secure-1/public/favicon.ico -------------------------------------------------------------------------------- /test-dev/smoke-secure-1/public/index.css: -------------------------------------------------------------------------------- 1 | #img { 2 | display: block; 3 | margin: auto; 4 | height: 128px; 5 | width: 128px; 6 | padding: 2rem; 7 | } 8 | 9 | #canvas { 10 | display: block; 11 | margin: 2rem auto; 12 | width: 540px; 13 | height: 540px; 14 | } 15 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-1/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devOptions: { 3 | open: "none", 4 | secure: true 5 | }, 6 | mount: { 7 | public: "/", 8 | src: "/_dist_" 9 | }, 10 | plugins: [ 11 | [ 12 | '@snowpack/plugin-build-script', 13 | { 14 | input: ['.tmpl'], 15 | output: ['.html'], 16 | cmd: 'cat $FILE', 17 | }, 18 | ], 19 | ], 20 | }; 21 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-1/src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is just a silly example to show everything working in the browser. 3 | * When you're ready to start on your site, clear the file. Happy hacking! 4 | **/ 5 | 6 | import confetti from 'canvas-confetti'; 7 | 8 | confetti.create(document.getElementById('canvas'), { 9 | resize: true, 10 | useWorker: true, 11 | })({particleCount: 200, spread: 200}); 12 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@snowpack/plugin-build-script": "^2.0.7", 4 | "canvas-confetti": "^1.2.0", 5 | "snowpack": "^3.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-2/public/about.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

this is a template in some language that builds to .html

6 | 7 | 8 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-2/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/test-dev/smoke-secure-2/public/favicon.ico -------------------------------------------------------------------------------- /test-dev/smoke-secure-2/public/index.css: -------------------------------------------------------------------------------- 1 | #img { 2 | display: block; 3 | margin: auto; 4 | height: 128px; 5 | width: 128px; 6 | padding: 2rem; 7 | } 8 | 9 | #canvas { 10 | display: block; 11 | margin: 2rem auto; 12 | width: 540px; 13 | height: 540px; 14 | } 15 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-2/snowpack.config.js: -------------------------------------------------------------------------------- 1 | const { readFileSync } = require('fs'); 2 | 3 | const cert = readFileSync("./tls/certificate.pem"); 4 | const key = readFileSync("./tls/key.pem"); 5 | 6 | module.exports = { 7 | devOptions: { 8 | open: "none", 9 | secure: { cert, key }, 10 | }, 11 | mount: { 12 | public: "/", 13 | src: "/_dist_" 14 | }, 15 | plugins: [ 16 | [ 17 | '@snowpack/plugin-build-script', 18 | { 19 | input: ['.tmpl'], 20 | output: ['.html'], 21 | cmd: 'cat $FILE', 22 | }, 23 | ], 24 | ], 25 | }; 26 | -------------------------------------------------------------------------------- /test-dev/smoke-secure-2/src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is just a silly example to show everything working in the browser. 3 | * When you're ready to start on your site, clear the file. Happy hacking! 4 | **/ 5 | 6 | import confetti from 'canvas-confetti'; 7 | 8 | confetti.create(document.getElementById('canvas'), { 9 | resize: true, 10 | useWorker: true, 11 | })({particleCount: 200, spread: 200}); 12 | -------------------------------------------------------------------------------- /test-dev/smoke/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@snowpack/plugin-build-script": "^2.0.7", 4 | "canvas-confetti": "^1.2.0", 5 | "snowpack": "^3.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-dev/smoke/public/about.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

this is a template in some language that builds to .html

6 | 7 | 8 | -------------------------------------------------------------------------------- /test-dev/smoke/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/test-dev/smoke/public/favicon.ico -------------------------------------------------------------------------------- /test-dev/smoke/public/index.css: -------------------------------------------------------------------------------- 1 | #img { 2 | display: block; 3 | margin: auto; 4 | height: 128px; 5 | width: 128px; 6 | padding: 2rem; 7 | } 8 | 9 | #canvas { 10 | display: block; 11 | margin: 2rem auto; 12 | width: 540px; 13 | height: 540px; 14 | } 15 | -------------------------------------------------------------------------------- /test-dev/smoke/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devOptions: { 3 | open: "none" 4 | }, 5 | mount: { 6 | public: "/", 7 | src: "/_dist_" 8 | }, 9 | plugins: [ 10 | [ 11 | '@snowpack/plugin-build-script', 12 | { 13 | input: ['.tmpl'], 14 | output: ['.html'], 15 | cmd: 'cat $FILE', 16 | }, 17 | ], 18 | ], 19 | }; 20 | -------------------------------------------------------------------------------- /test-dev/smoke/src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is just a silly example to show everything working in the browser. 3 | * When you're ready to start on your site, clear the file. Happy hacking! 4 | **/ 5 | 6 | import confetti from 'canvas-confetti'; 7 | 8 | confetti.create(document.getElementById('canvas'), { 9 | resize: true, 10 | useWorker: true, 11 | })({particleCount: 200, spread: 200}); 12 | -------------------------------------------------------------------------------- /test/build/config-loading-esm-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "0.1.0", 4 | "type": "module", 5 | "name": "@snowpack/test-config-loading-esm-package", 6 | "scripts": { 7 | "testbuild": "snowpack build" 8 | }, 9 | "dependencies": { 10 | "snowpack": "^3.8.8" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/build/config-loading-esm-package/snowpack.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | buildOptions: { 3 | out: 'TEST_BUILD_OUT', 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /test/build/config-loading-esm-package/src/index.js: -------------------------------------------------------------------------------- 1 | console.log(import.meta.env); 2 | -------------------------------------------------------------------------------- /test/build/config-loading-mjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "0.1.0", 4 | "name": "@snowpack/test-config-loading-mjs", 5 | "scripts": { 6 | "testbuild": "snowpack build" 7 | }, 8 | "dependencies": { 9 | "snowpack": "^3.8.8" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/build/config-loading-mjs/snowpack.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | buildOptions: { 3 | "out": "TEST_BUILD_OUT" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/build/config-loading-mjs/src/index.js: -------------------------------------------------------------------------------- 1 | console.log(import.meta.env); 2 | -------------------------------------------------------------------------------- /test/build/config-path/config-path.test.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const {setupBuildTest, readFiles} = require('../../test-utils'); 3 | 4 | const cwd = path.join(__dirname, 'build'); 5 | let files = {}; 6 | 7 | describe('snowpack build --config path', () => { 8 | beforeAll(() => { 9 | setupBuildTest(__dirname); 10 | 11 | files = readFiles(cwd); 12 | }); 13 | 14 | it('loads correctly', () => { 15 | expect(files['/index.js']).toBeTruthy(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /test/build/config-path/index.js: -------------------------------------------------------------------------------- 1 | export default function () {} 2 | -------------------------------------------------------------------------------- /test/build/config-path/my-config-file.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /test/build/config-path/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpackjs/test-config-path", 3 | "description": "Passing --config", 4 | "version": "1.0.0", 5 | "main": "index.js", 6 | "scripts": { 7 | "testbuild": "snowpack build --config my-config-file.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/build/entrypoint-ids/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.0", 4 | "name": "@snowpack/test-entrypoint-ids", 5 | "description": "Tests that a non-canonical cwd works on case-insensitive file systems", 6 | "scripts": { 7 | "testbuild": "snowpack build" 8 | }, 9 | "snowpack": { 10 | "mount": { 11 | "./src": "/_dist_" 12 | } 13 | }, 14 | "dependencies": { 15 | "chalk": "4.1.0", 16 | "ansi-styles": "*" 17 | }, 18 | "devDependencies": { 19 | "snowpack": "^3.8.8" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/build/entrypoint-ids/src/index.js: -------------------------------------------------------------------------------- 1 | import 'chalk'; 2 | import 'ansi-styles'; 3 | -------------------------------------------------------------------------------- /test/build/import-assets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-import-css", 5 | "description": "A test to make sure that URLs for resources don’t have backslashes on Windows", 6 | "scripts": { 7 | "start": "snowpack dev", 8 | "testbuild": "snowpack build" 9 | }, 10 | "devDependencies": { 11 | "snowpack": "^3.8.8" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/build/import-assets/snowpack.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "mount": { 3 | "./src": "/_dist_" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/build/import-assets/src/index.js: -------------------------------------------------------------------------------- 1 | import './styles.css'; 2 | import './logo.png'; 3 | 4 | console.log('loaded'); 5 | -------------------------------------------------------------------------------- /test/build/import-assets/src/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/test/build/import-assets/src/logo.png -------------------------------------------------------------------------------- /test/build/import-assets/src/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: fantasy; 3 | } 4 | -------------------------------------------------------------------------------- /test/build/package-bootstrap/package-bootstrap.test.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const {setupBuildTest, readFiles} = require('../../test-utils'); 3 | 4 | const cwd = path.join(__dirname, 'build'); 5 | let files = {}; 6 | 7 | describe('package: bootstrap', () => { 8 | beforeAll(() => { 9 | setupBuildTest(__dirname); 10 | 11 | files = readFiles(cwd); 12 | }); 13 | 14 | it('resolves JS', () => { 15 | expect(files['/_dist_/index.js']).toEqual( 16 | expect.stringContaining( 17 | `import '../_snowpack/pkg/bootstrap/dist/css/bootstrap.min.css.proxy.js';`, 18 | ), 19 | ); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /test/build/package-bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-package-bootstrap", 5 | "description": "Tests that CSS proxy files are properly imported from _snowpack/pkg", 6 | "scripts": { 7 | "testbuild": "snowpack build" 8 | }, 9 | "snowpack": { 10 | "mount": { 11 | "./src": "/_dist_" 12 | } 13 | }, 14 | "dependencies": { 15 | "bootstrap": "^4.5.2" 16 | }, 17 | "devDependencies": { 18 | "snowpack": "^3.8.8" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/build/package-bootstrap/src/index.js: -------------------------------------------------------------------------------- 1 | import 'bootstrap/dist/css/bootstrap.min.css'; 2 | 3 | console.log('CSS added to page!'); 4 | -------------------------------------------------------------------------------- /test/build/package-bootstrap/src/styles.css: -------------------------------------------------------------------------------- 1 | @import "bootstrap/dist/css/bootstrap.min.css"; -------------------------------------------------------------------------------- /test/build/package-workspace/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-package-workspace", 5 | "description": "A test to make sure linked packages are supported", 6 | "scripts": { 7 | "testbuild": "snowpack build" 8 | }, 9 | "devDependencies": { 10 | "snowpack": "^3.8.8" 11 | }, 12 | "dependencies": { 13 | "test-workspace-component": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/build/package-workspace/snowpack.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import("snowpack").SnowpackUserConfig } */ 2 | module.exports = { 3 | workspaceRoot: '../', 4 | buildOptions: { 5 | out: './build', 6 | }, 7 | mount: { 8 | src: '/_dist_', 9 | }, 10 | plugins: [['@snowpack/plugin-svelte']], 11 | }; 12 | -------------------------------------------------------------------------------- /test/build/package-workspace/src/index.svelte: -------------------------------------------------------------------------------- 1 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/build/plugin-build-script/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-plugin-build-script", 5 | "description": "A test to make sure @snowpack/plugin-build-script works", 6 | "scripts": { 7 | "testbuild": "snowpack build" 8 | }, 9 | "devDependencies": { 10 | "@babel/cli": "^7.10.5", 11 | "@snowpack/plugin-build-script": "^2.0.0", 12 | "snowpack": "^3.8.8" 13 | }, 14 | "dependencies": { 15 | "@babel/preset-typescript": "^7.13.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/build/plugin-build-script/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mount: { 3 | src: '/_dist_', 4 | }, 5 | plugins: [ 6 | [ 7 | '@snowpack/plugin-build-script', 8 | { 9 | input: ['.ts'], 10 | output: ['.js'], 11 | cmd: 'babel --filename $FILE --presets @babel/preset-typescript', 12 | }, 13 | ], 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /test/build/plugin-build-script/src/index.ts: -------------------------------------------------------------------------------- 1 | type stringType = string; 2 | const msg: stringType = 'I’m a TypeScript file'; 3 | console.log(msg); 4 | -------------------------------------------------------------------------------- /test/build/plugin-hook-optimize/custom-optimize-plugin.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs').promises; 2 | const path = require('path'); 3 | 4 | module.exports = function () { 5 | return { 6 | optimize: async ({buildDirectory}) => { 7 | await fs.writeFile(path.join(buildDirectory, 'artifact.txt'), 'TEST: Directory optimized!'); 8 | }, 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /test/build/plugin-hook-optimize/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-plugin-hook-optimize", 5 | "description": "A test to make sure that the plugin optimize() hook is working as expected", 6 | "scripts": { 7 | "start": "snowpack dev", 8 | "testbuild": "snowpack build" 9 | }, 10 | "devDependencies": { 11 | "@snowpack/plugin-optimize": "^0.2.0", 12 | "snowpack": "^3.8.8" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/build/plugin-hook-optimize/snowpack.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "mount": { 3 | "./src": "/_dist_" 4 | }, 5 | "plugins": ["./custom-optimize-plugin.js"] 6 | } 7 | -------------------------------------------------------------------------------- /test/build/plugin-hook-optimize/src/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/build/plugin-hook-optimize/src/index.js: -------------------------------------------------------------------------------- 1 | import './styles.css'; 2 | import './logo.png'; 3 | import iconComponent from './icon.svg'; 4 | 5 | console.log('loaded'); 6 | -------------------------------------------------------------------------------- /test/build/plugin-hook-optimize/src/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/test/build/plugin-hook-optimize/src/logo.png -------------------------------------------------------------------------------- /test/build/plugin-hook-optimize/src/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: fantasy; 3 | } 4 | -------------------------------------------------------------------------------- /test/build/plugin-run-script/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-plugin-run-script", 5 | "description": "A test to make sure @snowpack/plugin-run-script works", 6 | "scripts": { 7 | "testbuild": "snowpack build" 8 | }, 9 | "devDependencies": { 10 | "@snowpack/plugin-run-script": "^2.0.0", 11 | "sass": "^1.26.10", 12 | "snowpack": "^3.8.8" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/build/plugin-run-script/plugin-run-script.test.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const {setupBuildTest} = require('../../test-utils'); 4 | 5 | const cwd = path.join(__dirname, 'build'); 6 | 7 | describe('@snowpack/plugin-run-script', () => { 8 | beforeAll(() => { 9 | setupBuildTest(__dirname); 10 | }); 11 | 12 | it('generates .scss -> .css', () => { 13 | const css = path.join(cwd, 'css', 'index.css'); 14 | expect(fs.existsSync(css)).toBe(true); // file exists 15 | expect(fs.readFileSync(css, 'utf-8')).toBeTruthy(); // file has content 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /test/build/plugin-run-script/public/css/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "fantasy"; 3 | } 4 | -------------------------------------------------------------------------------- /test/build/plugin-run-script/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mount: { 3 | public: '/', 4 | }, 5 | plugins: [ 6 | [ 7 | '@snowpack/plugin-run-script', 8 | { 9 | cmd: 'sass src/css:public/css --no-source-map', 10 | }, 11 | ], 12 | ], 13 | }; 14 | -------------------------------------------------------------------------------- /test/build/plugin-run-script/src/css/index.scss: -------------------------------------------------------------------------------- 1 | $body-font: "fantasy"; 2 | 3 | body { 4 | font-family: $body-font; 5 | } 6 | -------------------------------------------------------------------------------- /test/build/prepare-external-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.0", 4 | "name": "@snowpack/test-prepare-external-package", 5 | "description": "Test for packageOptions.external as it applies to prepare.", 6 | "scripts": { 7 | "testbuild": "snowpack prepare" 8 | }, 9 | "snowpack": { 10 | "mount": { 11 | "./src": "/_dist_" 12 | }, 13 | "packageOptions": { 14 | "external": [ 15 | "fs", 16 | "vue/types" 17 | ], 18 | "source": "local" 19 | } 20 | }, 21 | "devDependencies": { 22 | "snowpack": "^3.8.8" 23 | }, 24 | "dependencies": { 25 | "array-flatten": "^3.0.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/build/prepare-external-package/src/index.js: -------------------------------------------------------------------------------- 1 | import 'fs'; 2 | import 'array-flatten'; 3 | import 'vue/types'; 4 | -------------------------------------------------------------------------------- /test/build/react-lazy-bundle/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpackjs/test-react-lazy", 3 | "description": "Tests React Lazy component resolution", 4 | "version": "1.0.0", 5 | "scripts": { 6 | "testbuild": "snowpack build" 7 | }, 8 | "dependencies": { 9 | "react": "^17.0.2", 10 | "react-dom": "^17.0.2", 11 | "react-router": "^5.2.0", 12 | "react-router-dom": "^5.2.0" 13 | }, 14 | "devDependencies": { 15 | "@snowpack/plugin-react-refresh": "^2.5.0", 16 | "@snowpack/plugin-sass": "^1.4.0", 17 | "snowpack": "^3.3.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/build/react-lazy-bundle/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | React Lazy Test 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/build/react-lazy-bundle/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mount: { 3 | public: {url: '/', static: true, resolve: false}, 4 | src: {url: '/dist'}, 5 | }, 6 | optimize: { 7 | bundle: true, 8 | minify: true, 9 | sourcemap: true, 10 | splitting: true, 11 | treeshake: true, 12 | target: 'safari11', 13 | }, 14 | plugins: ['@snowpack/plugin-sass', '@snowpack/plugin-react-refresh'], 15 | }; 16 | -------------------------------------------------------------------------------- /test/build/react-lazy-bundle/src/components/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | function App({children}) { 4 | return
{children}
; 5 | } 6 | export default App; 7 | -------------------------------------------------------------------------------- /test/build/react-lazy-bundle/src/components/Articles.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | function Articles() { 4 | return

Articles

; 5 | } 6 | 7 | export default Articles; 8 | -------------------------------------------------------------------------------- /test/build/react-lazy-bundle/src/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import {BrowserRouter as Router, Route, Switch} from 'react-router-dom'; 4 | import App from './components/App'; 5 | 6 | const Articles = React.lazy(() => import('./components/Articles')); 7 | 8 | ReactDOM.render( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | , 20 | document.querySelector('#app'), 21 | ); 22 | -------------------------------------------------------------------------------- /test/build/test-workspace-component/Layout.ts: -------------------------------------------------------------------------------- 1 | export const bob = 42; 2 | -------------------------------------------------------------------------------- /test/build/test-workspace-component/README.md: -------------------------------------------------------------------------------- 1 | # test-workspace-component 2 | 3 | This is a test component for the workspace that lets us test symlink support. It is private, not published, and should not ever be needed outside of testing. -------------------------------------------------------------------------------- /test/build/test-workspace-component/SvelteComponent.svelte: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 |
12 | Hello! This is a test component! 13 |
14 | -------------------------------------------------------------------------------- /test/build/test-workspace-component/index.mjs: -------------------------------------------------------------------------------- 1 | export * from './Layout' 2 | 3 | export function testComponent() { 4 | return 42; 5 | } -------------------------------------------------------------------------------- /test/build/test-workspace-component/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-workspace-component", 3 | "private": true, 4 | "version": "1.0.0", 5 | "license": "MIT", 6 | "main": "index.mjs", 7 | "dependencies": { 8 | "canvas-confetti": "^1.2.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/build/test-workspace-component/works-without-extension.ts: -------------------------------------------------------------------------------- 1 | export function testFn() { 2 | return 42 as number; 3 | } 4 | -------------------------------------------------------------------------------- /test/esinstall/alias/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-config-alias", 5 | "description": "Handle deep imports to package entrypoints", 6 | "dependencies": { 7 | "preact": "^10.0.0", 8 | "vue": "^2.6.12", 9 | "vue-currency-input": "^1.21.0" 10 | }, 11 | "devDependencies": { 12 | "snowpack": "^3.8.8" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/esinstall/cjs-autodetect-exports/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/cjs-autodetect-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-autodetect-cjs", 5 | "dependencies": { 6 | "cjs-invalid-exports": "file:./packages/cjs-invalid-exports", 7 | "cjs-valid-exports": "file:./packages/cjs-valid-exports" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/esinstall/cjs-autodetect-exports/packages/cjs-invalid-exports/entrypoint.js: -------------------------------------------------------------------------------- 1 | 2 | var mod = { 3 | "a": "b", 4 | ")": "ooops, this is an invalid identifier" 5 | }; 6 | 7 | module.exports = mod; -------------------------------------------------------------------------------- /test/esinstall/cjs-autodetect-exports/packages/cjs-invalid-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "cjs-invalid-exports", 4 | "main": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/cjs-autodetect-exports/packages/cjs-valid-exports/entrypoint.js: -------------------------------------------------------------------------------- 1 | 2 | var mod = { 3 | "a": "b", 4 | "b": "c", 5 | "d": "see, these are all valid" 6 | }; 7 | 8 | module.exports = mod; -------------------------------------------------------------------------------- /test/esinstall/cjs-autodetect-exports/packages/cjs-valid-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "cjs-valid-exports", 4 | "main": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/config-package-svelte/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-config-package-svelte", 5 | "description": "Handle svelte packages", 6 | "dependencies": { 7 | "simple-svelte-autocomplete": "1.2.4" 8 | }, 9 | "devDependencies": { 10 | "snowpack": "^3.8.8" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/esinstall/config-package-svelte/src/index.js: -------------------------------------------------------------------------------- 1 | import 'simple-svelte-autocomplete'; 2 | -------------------------------------------------------------------------------- /test/esinstall/dep-list-simple/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-dep-list-simple", 5 | "dependencies": { 6 | "async": "3.1.0", 7 | "snowpack": "^3.8.8" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/esinstall/error-missing-dep/__snapshots__: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`error-missing-dep matches the snapshot: allFiles 1`] = `Array []`; 4 | 5 | exports[`error-missing-dep matches the snapshot: cli output 1`] = ` 6 | "[snowpack] ! installing dependencies... 7 | [snowpack] Package \\"fake-module\\" not found. Have you installed it?" 8 | `; 9 | -------------------------------------------------------------------------------- /test/esinstall/error-missing-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-error-missing-dep", 5 | "devDependencies": { 6 | "snowpack": "^3.8.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/exclude-external-packages/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-exclude-external-packages", 5 | "dependencies": { 6 | "react": "17.0.1", 7 | "react-dom": "17.0.1" 8 | }, 9 | "devDependencies": { 10 | "snowpack": "^3.8.8" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/esinstall/exports-only-no-main/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/exports-only-no-main/exports-only-no-main.test.js: -------------------------------------------------------------------------------- 1 | const {runTest} = require('../esinstall-test-utils.js'); 2 | const execa = require('execa'); 3 | const path = require('path'); 4 | 5 | describe('Package with only exports and no main', () => { 6 | it('Is able to install the dependencies without error', async () => { 7 | const cwd = __dirname; 8 | 9 | await execa('yarn', ['--silent', 'run', 'testinstall'], { 10 | cwd, 11 | reject: true, 12 | }); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /test/esinstall/exports-only-no-main/mod.js: -------------------------------------------------------------------------------- 1 | import 'exports-only-no-main/mod'; 2 | -------------------------------------------------------------------------------- /test/esinstall/exports-only-no-main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/test-exports-only-no-main", 3 | "version": "1.0.0", 4 | "main": "./mod.js", 5 | "scripts": { 6 | "testinstall": "snowpack prepare", 7 | "debuginstall": "node --inspect-brk ../../../node_modules/.bin/snowpack prepare" 8 | }, 9 | "dependencies": { 10 | "exports-only-no-main": "file:./pkg" 11 | }, 12 | "devDependencies": { 13 | "snowpack": "^3.8.8" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/esinstall/exports-only-no-main/pkg/mod.mjs: -------------------------------------------------------------------------------- 1 | export let a = 'no main'; -------------------------------------------------------------------------------- /test/esinstall/exports-only-no-main/pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/test-esinstall-pkg-exports-only-no-main", 3 | "version": "1.0.0", 4 | "exports": { 5 | "./mod": { 6 | "import": "./mod.mjs" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/esinstall/exports-only-no-main/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /test/esinstall/exports-only/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/exports-only/exports-only.test.js: -------------------------------------------------------------------------------- 1 | const {runTest} = require('../esinstall-test-utils.js'); 2 | const execa = require('execa'); 3 | const path = require('path'); 4 | 5 | describe('Package with only exports', () => { 6 | it('Is able to install the dependencies without error', async () => { 7 | const cwd = __dirname; 8 | 9 | await execa('yarn', ['--silent', 'run', 'testinstall'], { 10 | cwd, 11 | reject: true, 12 | }); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /test/esinstall/exports-only/mod.js: -------------------------------------------------------------------------------- 1 | import 'exports-only'; 2 | -------------------------------------------------------------------------------- /test/esinstall/exports-only/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/test-exports-only", 3 | "version": "1.0.0", 4 | "main": "./mod.js", 5 | "scripts": { 6 | "testinstall": "snowpack prepare", 7 | "debuginstall": "node --inspect-brk ../../../node_modules/.bin/snowpack prepare" 8 | }, 9 | "dependencies": { 10 | "exports-only": "file:./pkg" 11 | }, 12 | "devDependencies": { 13 | "snowpack": "^3.8.8" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/esinstall/exports-only/pkg/mod.mjs: -------------------------------------------------------------------------------- 1 | export let a = 'b'; -------------------------------------------------------------------------------- /test/esinstall/exports-only/pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/test-esinstall-pkg-no-exports", 3 | "version": "1.0.0", 4 | "exports": { 5 | ".": { 6 | "import": "./mod.mjs" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /test/esinstall/exports-only/snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /test/esinstall/import-assets/.gitignore: -------------------------------------------------------------------------------- 1 | test-* 2 | -------------------------------------------------------------------------------- /test/esinstall/import-assets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-import-assets", 5 | "dependencies": { 6 | "mock-pkg-install-assets": "file:./packages/mock-pkg-install-assets" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/import-assets/packages/mock-pkg-install-assets/css.css: -------------------------------------------------------------------------------- 1 | body { background-color: blue; } 2 | -------------------------------------------------------------------------------- /test/esinstall/import-assets/packages/mock-pkg-install-assets/jpg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/test/esinstall/import-assets/packages/mock-pkg-install-assets/jpg.jpg -------------------------------------------------------------------------------- /test/esinstall/import-assets/packages/mock-pkg-install-assets/json.json: -------------------------------------------------------------------------------- 1 | {"type": "json"} 2 | -------------------------------------------------------------------------------- /test/esinstall/import-assets/packages/mock-pkg-install-assets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "mock-pkg-install-assets" 4 | } 5 | -------------------------------------------------------------------------------- /test/esinstall/import-assets/packages/mock-pkg-install-assets/svg.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/esinstall/import-astro/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/import-astro/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-dep-astro", 5 | "dependencies": { 6 | "astro-components": "file:./packages/components" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/import-astro/packages/components/Wow.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const foo = 'bar'; 3 | --- 4 |
Hello world
-------------------------------------------------------------------------------- /test/esinstall/import-astro/packages/components/package.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "version": "1.0.0", 4 | "name": "astro-components", 5 | "main": "Wow.astro" 6 | } 7 | -------------------------------------------------------------------------------- /test/esinstall/import-missing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-import-missing" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/import-missing/packages/@material/animation/_functions.import.scss: -------------------------------------------------------------------------------- 1 | @forward "./index" as mdc-animation-*; 2 | -------------------------------------------------------------------------------- /test/esinstall/import-missing/packages/@material/animation/_index.scss: -------------------------------------------------------------------------------- 1 | @forward "./variables"; 2 | @forward "./functions"; 3 | -------------------------------------------------------------------------------- /test/esinstall/import-missing/packages/@material/animation/_variables.import.scss: -------------------------------------------------------------------------------- 1 | @forward "./index" as mdc-animation-* hide mdc-animation-enter, mdc-animation-exit-permanent, mdc-animation-exit-temporary, mdc-animation-standard; 2 | -------------------------------------------------------------------------------- /test/esinstall/import-missing/packages/@material/animation/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAC,IAAI,EAAC,CAAC,CAAC,gBAAgB;AAE/B,cAAc,QAAQ,CAAC,CAAC,2CAA2C"} -------------------------------------------------------------------------------- /test/esinstall/import-missing/packages/@material/animation/types.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"} -------------------------------------------------------------------------------- /test/esinstall/import-missing/packages/tslib/tslib.es6.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/esinstall/import-missing/packages/tslib/tslib.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/esinstall/import-missing/src/index.js: -------------------------------------------------------------------------------- 1 | import {MDCList} from '@material/list'; 2 | 3 | const list = new MDCList(document.querySelector('.mdc-list')); 4 | -------------------------------------------------------------------------------- /test/esinstall/import-named-from-default/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-import-named-from-default", 5 | "dependencies": { 6 | "default-only-esm": "file:./package/default-only-esm" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/import-named-from-default/package/default-only-esm/index.js: -------------------------------------------------------------------------------- 1 | function EventEmitter() {} 2 | 3 | export default EventEmitter; 4 | -------------------------------------------------------------------------------- /test/esinstall/import-named-from-default/package/default-only-esm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "default-only-esm", 3 | "version": "0.1.0", 4 | "module": "index.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/import-node-builtin/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/import-node-builtin/error-node-builtin-unresolved.test.js: -------------------------------------------------------------------------------- 1 | const {runTest} = require('../esinstall-test-utils.js'); 2 | const path = require('path'); 3 | 4 | describe('node builtins', () => { 5 | it('throws without a polyfill', async () => { 6 | const cwd = __dirname; 7 | const dest = path.join(cwd, 'test-error-node-builtin'); 8 | 9 | const targets = ['bad-node-builtin-pkg']; 10 | 11 | const run = async () => { 12 | await runTest(targets, { 13 | cwd, 14 | dest, 15 | }); 16 | }; 17 | 18 | return expect(run).rejects.toThrow(); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /test/esinstall/import-node-builtin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-error-node-builtin-unresolved", 5 | "dependencies": { 6 | "bad-node-builtin-pkg": "file:./packages/bad-node-builtin-pkg" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/import-node-builtin/packages/bad-node-builtin-pkg/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const FOO = 42; 2 | // ERROR: This shouldn't work without polyfill support 3 | import 'http'; 4 | -------------------------------------------------------------------------------- /test/esinstall/import-node-builtin/packages/bad-node-builtin-pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "bad-node-builtin-pkg", 4 | "module": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/import-nothing/import-nothing.test.js: -------------------------------------------------------------------------------- 1 | const {install} = require('../../../esinstall/lib'); 2 | 3 | describe('error-no-dep-list', () => { 4 | it('importing nothing', async () => { 5 | return expect(() => 6 | install( 7 | [ 8 | /* nothing! */ 9 | ], 10 | {cwd: __dirname}, 11 | ), 12 | ).rejects.toThrowError(`No ESM dependencies found! 13 | At least one dependency must have an ESM "module" entrypoint. You can find modern, web-ready packages at https://www.skypack.dev`); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /test/esinstall/import-nothing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-import-nothing", 5 | "devDependencies": { 6 | "snowpack": "^3.8.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/import-types/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/import-types/import-types.test.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const {runTest} = require('../esinstall-test-utils.js'); 3 | 4 | describe('importing types', () => { 5 | it('generates an error', async () => { 6 | const cwd = __dirname; 7 | const dest = path.join(cwd, 'test-types-only'); 8 | 9 | // Run Test 10 | try { 11 | await runTest(['type-only-pkg', 'array-flatten'], {cwd, dest}); 12 | expect(false).toEqual(true); // should not finish 13 | } catch (err) { 14 | expect(err.message).toContain('Unable to find any entrypoint for "type-only-pkg"'); 15 | } 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /test/esinstall/import-types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-dep-types-only", 5 | "dependencies": { 6 | "array-flatten": "^3.0.0", 7 | "type-only-pkg": "file:./packages/type-only-pkg" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/esinstall/import-types/packages/type-only-pkg/index.d.ts: -------------------------------------------------------------------------------- 1 | export type Foo = 'i am types only!'; 2 | -------------------------------------------------------------------------------- /test/esinstall/import-types/packages/type-only-pkg/package.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "version": "1.0.0", 4 | "name": "type-only-package", 5 | "types": "index.d.ts" 6 | } 7 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/.gitignore: -------------------------------------------------------------------------------- 1 | test-* 2 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-esinstall-named-exports", 5 | "description": "Handle automatic named export detection for cjs packages", 6 | "scripts": { 7 | "testinstall": "snowpack install" 8 | }, 9 | "dependencies": { 10 | "cjs-named-exports-obj": "file:./packages/cjs-named-exports-obj", 11 | "cjs-named-exports-reexported": "file:./packages/cjs-named-exports-reexported", 12 | "cjs-named-exports-simple": "file:./packages/cjs-named-exports-simple", 13 | "umd-named-exports": "file:./packages/umd-named-exports" 14 | }, 15 | "devDependencies": { 16 | "snowpack": "^3.8.8" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/cjs-named-exports-obj/entrypoint.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | export1: 'foo', 3 | export2: 'bar', 4 | }; 5 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/cjs-named-exports-obj/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cjs-named-exports-obj", 3 | "version": "1.0.0", 4 | "main": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/cjs-named-exports-reexported/entrypoint.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./reexported'); -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/cjs-named-exports-reexported/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cjs-named-exports-reexported", 3 | "version": "1.2.3", 4 | "main": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/cjs-named-exports-reexported/reexported.js: -------------------------------------------------------------------------------- 1 | exports.export42 = 'foobar'; 2 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/cjs-named-exports-simple/entrypoint.js: -------------------------------------------------------------------------------- 1 | exports.export1 = 1; 2 | exports.export2 = 'foo'; 3 | exports.export3 = function foo() {} 4 | exports.export4 = () => {} 5 | exports.export5 = null; 6 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/cjs-named-exports-simple/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cjs-named-exports-simple", 3 | "version": "1.2.3", 4 | "main": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/named-exports/packages/umd-named-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "umd-named-exports", 3 | "version": "0.7.0", 4 | "main": "autolayout.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/node-env/.gitignore: -------------------------------------------------------------------------------- 1 | test-* 2 | -------------------------------------------------------------------------------- /test/esinstall/node-env/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-node-env", 5 | "dependencies": { 6 | "node-env-mock-pkg": "file:./packages/node-env-mock-pkg" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/node-env/packages/node-env-mock-pkg/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const string = process.env.ENV_STRING; 2 | export const number = process.env.ENV_NUMBER; 3 | export const boolean = process.env.ENV_BOOLEAN; 4 | export const array = process.env.ENV_ARRAY; 5 | export const object = process.env.ENV_OBJECT; 6 | export const nullValue = process.env.ENV_NULL; 7 | export const undefinedValue = process.env.ENV_UNDEFINED; 8 | -------------------------------------------------------------------------------- /test/esinstall/node-env/packages/node-env-mock-pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "node-env-mock-pkg", 4 | "browser": { 5 | "./index.js": "entrypoint.js", 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot-slash-index-js/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot-slash-index-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-dot-slash-index-js", 3 | "version": "1.2.3", 4 | "browser": { 5 | "./index.js": "entrypoint.js", 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot-slash-index/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot-slash-index/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-dot-slash-index", 3 | "version": "1.2.3", 4 | "browser": { 5 | "./index": "entrypoint.js", 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot-slash/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot-slash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-dot-slash", 3 | "version": "1.2.3", 4 | "browser": { 5 | "./": "entrypoint.js", 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-dot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-dot", 3 | "version": "1.2.3", 4 | "browser": { 5 | ".": "entrypoint.js", 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-index-js/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-index-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-index-js", 3 | "version": "1.2.3", 4 | "browser": { 5 | "index.js": "entrypoint.js", 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-index/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-index/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-index", 3 | "version": "1.2.3", 4 | "browser": { 5 | "index": "entrypoint.js", 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-no-valid/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-no-valid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-no-valid", 3 | "version": "1.2.3", 4 | "main": "entrypoint.js", 5 | "browser": { 6 | "./bad": "bad" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-path/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/browser-path/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-path", 3 | "version": "1.2.3", 4 | "browser": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-dot-no-slash/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const FOO = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-dot-no-slash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-dot-no-slash", 4 | "description": "./", 5 | "exports": { 6 | ".": "./entrypoint.js" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-dot-slash/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | 3 | // ERROR: This shouldn't work without polyfill support 4 | import 'http'; 5 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-dot-slash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-dot-slash", 4 | "description": "With dot slash", 5 | "exports": { 6 | "./": "./entrypoint.js" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-internal-imports/entrypoint.js: -------------------------------------------------------------------------------- 1 | import * as pkg from 'export-map-internal-imports/imported-by-entrypoint'; 2 | console.log(pkg); 3 | export const a = 3; 4 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-internal-imports/imported-by-entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 2; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-internal-imports/imports-entrypoint.js: -------------------------------------------------------------------------------- 1 | import * as pkg from 'export-map-internal-imports'; 2 | console.log(pkg); 3 | 4 | export const a = 1; 5 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-internal-imports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-internal-imports", 4 | "exports": { 5 | ".": "./entrypoint.js", 6 | "./imported-by-entrypoint": "./imported-by-entrypoint.js", 7 | "./imports-entrypoint": "./imports-entrypoint.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-browser-object/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-browser-object/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-object-browser", 4 | "description": "With dot slash", 5 | "module": "./entrypoint.js", 6 | "exports": { 7 | ".": { 8 | "browser": { 9 | "development": "./no-exists.js", 10 | "production": "./also-no-exists.js" 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-browser/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-browser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-object-browser", 4 | "description": "With dot slash", 5 | "exports": { 6 | ".": { 7 | "default": "./no-exist.js", 8 | "browser": "./entrypoint.js" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-default/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-default/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-object-default", 4 | "description": "With dot slash", 5 | "exports": { 6 | ".": { 7 | "default": "./entrypoint.js" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-import/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-import/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-object-import", 4 | "description": "With dot slash", 5 | "exports": { 6 | ".": { 7 | "import": "./entrypoint.js" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-no-key/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-no-key/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-object-no-key", 4 | "description": "With dot slash", 5 | "exports": { 6 | "default": "./no-exist.js", 7 | "browser": "./entrypoint.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-require/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-object-require/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-object-require", 4 | "description": "With dot slash", 5 | "exports": { 6 | ".": { 7 | "require": "./entrypoint.js" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-star/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-star/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-star", 4 | "description": "With star (wildcards)", 5 | "exports": { 6 | ".": "./entrypoint.js", 7 | "./extras/*": "./src/extras/*.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-star/src/extras/one.js: -------------------------------------------------------------------------------- 1 | export const one = 'one'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-star/src/extras/other.css: -------------------------------------------------------------------------------- 1 | /* This should not be included */ 2 | body { background: darkorchid; } -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-star/src/extras/three.js: -------------------------------------------------------------------------------- 1 | export const three = 'three'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-star/src/extras/two.js: -------------------------------------------------------------------------------- 1 | export const two = 'two'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/dist/esm/helpers.js: -------------------------------------------------------------------------------- 1 | export const helpers = 'helpers'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/dist/index.js: -------------------------------------------------------------------------------- 1 | export const index = 'index'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "export-map-star", 4 | "description": "With star (wildcards)", 5 | "exports": { 6 | ".": "./entrypoint.js", 7 | "./extras/": "./src/extras/", 8 | "./more/": { 9 | "default": "./src/more/", 10 | "fake_prop": "./error/more/" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/one.js: -------------------------------------------------------------------------------- 1 | export const one = 'one'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/other.css: -------------------------------------------------------------------------------- 1 | /* This should not be included */ 2 | body { background: darkorchid; } -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/three.js: -------------------------------------------------------------------------------- 1 | export const three = 'three'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/two.js: -------------------------------------------------------------------------------- 1 | export const two = 'two'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/export-map-trailing-slash/src/more/one.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/implicit-main/index.d.ts: -------------------------------------------------------------------------------- 1 | export interface HelloJS { 2 | type: number; 3 | } 4 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/implicit-main/index.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/implicit-main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "implicit-main", 3 | "version": "1.2.3", 4 | "types": "index.d.ts" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/jsnext-main/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/jsnext-main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsnext-main", 3 | "version": "1.2.3", 4 | "main": "./lol-this-doesnt-exist.js", 5 | "jsnext:main": "./entrypoint.js" 6 | } 7 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/main-folder/entrypoint/index.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/main-folder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "esinstall-test-main-folder", 3 | "version": "1.2.3", 4 | "main": "./entrypoint" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/module/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const foobar = 42; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "module", 3 | "version": "1.2.3", 4 | "main": "./lol-this-doesnt-exist.js", 5 | "module": "./entrypoint.js" 6 | } 7 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/pkg-with-dot.in-the-name/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const a = 'b'; 2 | -------------------------------------------------------------------------------- /test/esinstall/package-entrypoints/pkg-with-dot.in-the-name/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-with-dot.in-the-name", 3 | "version": "1.0.0", 4 | "main": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/package-node-fetch/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/package-node-fetch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-dep-node-fetch", 5 | "description": "Handle specific node.js fetch polyfill packages", 6 | "scripts": { 7 | "testinstall": "snowpack install" 8 | }, 9 | "snowpack": { 10 | "packageOptions": { 11 | "knownEntrypoints": [ 12 | "dep-node-fetch-mock-pkg" 13 | ] 14 | } 15 | }, 16 | "dependencies": { 17 | "dep-node-fetch-mock-pkg": "file:./packages/dep-node-fetch-mock-pkg" 18 | }, 19 | "devDependencies": { 20 | "snowpack": "^3.8.8" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/esinstall/package-node-fetch/packages/dep-node-fetch-mock-pkg/entrypoint.js: -------------------------------------------------------------------------------- 1 | import * as fetch from 'node-fetch'; 2 | import * as fetch_ from 'whatwg-fetch'; 3 | console.log(fetch, fetch_); 4 | -------------------------------------------------------------------------------- /test/esinstall/package-node-fetch/packages/dep-node-fetch-mock-pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "dep-node-fetch-mock-pkg", 4 | "module": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/package-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-package-react", 5 | "description": "Ensures React still works", 6 | "dependencies": { 7 | "react": "16.13.1", 8 | "react-dom": "16.13.1" 9 | }, 10 | "devDependencies": { 11 | "snowpack": "^3.8.8" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/esinstall/package-react/src/index.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | import * as react from 'react'; 3 | import * as reactDOM from 'react-dom'; 4 | import {renderToString} from 'react-dom/server'; 5 | -------------------------------------------------------------------------------- /test/esinstall/polyfill-node/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/polyfill-node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-polyfill-node", 5 | "dependencies": { 6 | "node-builtin-pkg": "file:./packages/node-builtin-pkg" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/polyfill-node/packages/node-builtin-pkg/entrypoint.js: -------------------------------------------------------------------------------- 1 | export const FOO = 42; 2 | import * as path from 'path'; 3 | console.log(path); 4 | -------------------------------------------------------------------------------- /test/esinstall/polyfill-node/packages/node-builtin-pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.3", 3 | "name": "node-builtin-pkg", 4 | "module": "entrypoint.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/rollup/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/rollup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-config-rollup", 5 | "scripts": { 6 | "testinstall": "snowpack install" 7 | }, 8 | "dependencies": { 9 | "rollup-plugin-svelte": "^7.0.0", 10 | "svelte": "^3.18.2", 11 | "svelte-routing": "^1.4.0" 12 | }, 13 | "devDependencies": { 14 | "snowpack": "^3.8.8" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/esinstall/rollup/src/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | SvelteComponentDev, 3 | create_component, 4 | destroy_component, 5 | detach_dev, 6 | dispatch_dev, 7 | init, 8 | insert_dev, 9 | mount_component, 10 | noop, 11 | safe_not_equal, 12 | space, 13 | transition_in, 14 | transition_out, 15 | } from 'svelte/internal'; 16 | // this exports *.svelte files, and needs rollup-plugin-svelte 17 | import {Router, Route} from 'svelte-routing'; 18 | -------------------------------------------------------------------------------- /test/esinstall/source-map-strip/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-source-map-strip", 5 | "dependencies": { 6 | "@auth0/auth0-spa-js": "1.12.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/sub-package-json/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/sub-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.1", 4 | "name": "@snowpack/test-sub-package-json", 5 | "dependencies": { 6 | "solid-js": "^0.16.7" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/esinstall/sub-package-json/sub-package-json.test.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const {runTest} = require('../esinstall-test-utils.js'); 3 | 4 | describe('sub package with package.json', () => { 5 | it('resolves to the right place', async () => { 6 | const cwd = __dirname; 7 | const dest = path.join(cwd, 'test-sub-package-json'); 8 | const spec = 'solid-js/dom'; 9 | 10 | const { 11 | importMap: {imports}, 12 | } = await runTest([spec], { 13 | cwd, 14 | dest, 15 | }); 16 | 17 | expect(imports[spec]).toBeTruthy(); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /test/esinstall/tree-shake-expression/.gitignore: -------------------------------------------------------------------------------- 1 | test-* -------------------------------------------------------------------------------- /test/esinstall/tree-shake-expression/inner-module/main.js: -------------------------------------------------------------------------------- 1 | var wiggle = function wiggle() {}.bind(this); 2 | 3 | export default function () {} 4 | -------------------------------------------------------------------------------- /test/esinstall/tree-shake-expression/inner-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inner-module", 3 | "version": "1.0.0", 4 | "main": "main.js" 5 | } 6 | -------------------------------------------------------------------------------- /test/esinstall/tree-shake-expression/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@snowpack/test-tree-shake-expression", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "inner-module": "file:./inner-module" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/esinstall/tree-shake-expression/tree-shake-expression.test.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const {runTest} = require('../esinstall-test-utils.js'); 4 | 5 | const cwd = __dirname; 6 | 7 | describe('tree shaking expressions', () => { 8 | it('works', async () => { 9 | const pkg = 'inner-module'; 10 | const dest = path.join(cwd, 'test-output'); 11 | await runTest([pkg], {cwd, dest}); 12 | 13 | const output = fs.readFileSync(path.join(dest, `${pkg}.js`), 'utf8'); 14 | 15 | expect(output).toEqual( 16 | // left hand assignment not removed 17 | expect.stringContaining(`var wiggle`), 18 | ); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /test/snowpack/__template__/index.test.js: -------------------------------------------------------------------------------- 1 | const {testFixture} = require('../../fixture-utils'); 2 | const dedent = require('dedent'); 3 | 4 | describe('suite', () => { 5 | beforeAll(() => { 6 | // Needed until we make Snowpack's JS Build Interface quiet by default 7 | require('snowpack').logger.level = 'error'; 8 | }); 9 | 10 | it('test', async () => { 11 | const result = await testFixture({ 12 | 'index.js': dedent` 13 | // Content to prevent readFile error 14 | `, 15 | 'snowpack.config.js': dedent` 16 | module.exports = {} 17 | `, 18 | }); 19 | expect(result['index.js']); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /test/snowpack/config/plugins/instantiatedObject/__snapshots__/index.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`instantiatedObject Instantiated objects do not affect build 1`] = `"console.log('fooey');"`; 4 | -------------------------------------------------------------------------------- /www/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | src/pages/**/*.md -------------------------------------------------------------------------------- /www/astro.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | projectRoot: '.', 3 | pages: './src/pages', 4 | dist: './dist', 5 | public: './public', 6 | buildOptions: { 7 | site: 'https://snowpack.dev/', 8 | }, 9 | renderers: [ 10 | // When testing, we used this as a bit of a kitchen sink for Astro. 11 | // Keep the different mixing of frameworks just for fun, to show Astro off. 12 | '@astrojs/renderer-vue', 13 | '@astrojs/renderer-svelte', 14 | '@astrojs/renderer-preact', 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /www/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snowpack-www", 3 | "private": true, 4 | "version": "3.0.0", 5 | "scripts": { 6 | "start": "yarn copy && astro dev", 7 | "build": "yarn copy && astro build", 8 | "copy": "node scripts/copy.js" 9 | }, 10 | "dependencies": { 11 | "astro": "^0.19.1", 12 | "date-fns": "^2.19.0", 13 | "docsearch.js": "^2.6.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /www/public/favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /www/public/favicon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/favicon/android-chrome-512x512.png -------------------------------------------------------------------------------- /www/public/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /www/public/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /www/public/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /www/public/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/favicon/favicon.ico -------------------------------------------------------------------------------- /www/public/favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /www/public/img/JSAwardWinner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/JSAwardWinner.jpg -------------------------------------------------------------------------------- /www/public/img/JSAwardWinner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/JSAwardWinner.png -------------------------------------------------------------------------------- /www/public/img/ReactGuide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/ReactGuide.jpg -------------------------------------------------------------------------------- /www/public/img/SvelteGuide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/SvelteGuide.jpg -------------------------------------------------------------------------------- /www/public/img/banner-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/banner-2.jpg -------------------------------------------------------------------------------- /www/public/img/browser-logos-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/browser-logos-all.png -------------------------------------------------------------------------------- /www/public/img/extra-space-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/extra-space-3.jpg -------------------------------------------------------------------------------- /www/public/img/extra-space-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/extra-space-4.jpg -------------------------------------------------------------------------------- /www/public/img/extra-space-4.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/extra-space-4.mp4 -------------------------------------------------------------------------------- /www/public/img/guides/folder-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/folder-structure.png -------------------------------------------------------------------------------- /www/public/img/guides/getting-started/hello-world.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/getting-started/hello-world.gif -------------------------------------------------------------------------------- /www/public/img/guides/getting-started/npm-snowpack-confetti.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/getting-started/npm-snowpack-confetti.gif -------------------------------------------------------------------------------- /www/public/img/guides/getting-started/run-snowpack.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/getting-started/run-snowpack.jpg -------------------------------------------------------------------------------- /www/public/img/guides/getting-started/snowpack-build.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/getting-started/snowpack-build.gif -------------------------------------------------------------------------------- /www/public/img/guides/getting-started/snowpack-font-css.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/getting-started/snowpack-font-css.jpg -------------------------------------------------------------------------------- /www/public/img/guides/react/folderstructure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/folderstructure.png -------------------------------------------------------------------------------- /www/public/img/guides/react/hmr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/hmr.gif -------------------------------------------------------------------------------- /www/public/img/guides/react/minimalist-hello-world-react-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/minimalist-hello-world-react-logo.png -------------------------------------------------------------------------------- /www/public/img/guides/react/minimalist-hello-world-react-timer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/minimalist-hello-world-react-timer.png -------------------------------------------------------------------------------- /www/public/img/guides/react/minimalist-hello-world-react.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/minimalist-hello-world-react.png -------------------------------------------------------------------------------- /www/public/img/guides/react/minimalist-hello-world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/minimalist-hello-world.png -------------------------------------------------------------------------------- /www/public/img/guides/react/react-fast-refresh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/react-fast-refresh.gif -------------------------------------------------------------------------------- /www/public/img/guides/react/react.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/react/react.gif -------------------------------------------------------------------------------- /www/public/img/guides/svelte/svelte-component-snowpack.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/svelte/svelte-component-snowpack.gif -------------------------------------------------------------------------------- /www/public/img/guides/svelte/svelte-logo-snowpack.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/svelte/svelte-logo-snowpack.jpg -------------------------------------------------------------------------------- /www/public/img/guides/svelte/svelte-logo-style-snowpack.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/svelte/svelte-logo-style-snowpack.gif -------------------------------------------------------------------------------- /www/public/img/guides/svelte/svelte-snowpack-counter-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/guides/svelte/svelte-snowpack-counter-1.gif -------------------------------------------------------------------------------- /www/public/img/how-does-it-work.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/how-does-it-work.jpg -------------------------------------------------------------------------------- /www/public/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/logo.png -------------------------------------------------------------------------------- /www/public/img/logos/react.svg: -------------------------------------------------------------------------------- 1 | 2 | React Logo 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /www/public/img/logos/vue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/logos/vue.png -------------------------------------------------------------------------------- /www/public/img/news/3d-product.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/news/3d-product.jpeg -------------------------------------------------------------------------------- /www/public/img/news/learn-snow-youtube.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/news/learn-snow-youtube.jpg -------------------------------------------------------------------------------- /www/public/img/nomodule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/nomodule.png -------------------------------------------------------------------------------- /www/public/img/plug-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /www/public/img/plug-regular.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /www/public/img/post-snowpackv3-esbuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/post-snowpackv3-esbuild.png -------------------------------------------------------------------------------- /www/public/img/post-snowpackv3-jsapi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/post-snowpackv3-jsapi.png -------------------------------------------------------------------------------- /www/public/img/post-snowpackv3-routes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/post-snowpackv3-routes.png -------------------------------------------------------------------------------- /www/public/img/post-snowpackv3-runtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/post-snowpackv3-runtime.png -------------------------------------------------------------------------------- /www/public/img/react-guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/react-guide.png -------------------------------------------------------------------------------- /www/public/img/react-snarky-tweet-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/react-snarky-tweet-2.png -------------------------------------------------------------------------------- /www/public/img/react-snarky-tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/react-snarky-tweet.png -------------------------------------------------------------------------------- /www/public/img/snowpack-27-screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-27-screenshot-1.png -------------------------------------------------------------------------------- /www/public/img/snowpack-27-screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-27-screenshot-2.png -------------------------------------------------------------------------------- /www/public/img/snowpack-27-screenshot-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-27-screenshot-3.png -------------------------------------------------------------------------------- /www/public/img/snowpack-build-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-build-example.png -------------------------------------------------------------------------------- /www/public/img/snowpack-build-mov.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-build-mov.mov -------------------------------------------------------------------------------- /www/public/img/snowpack-dev-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-dev-example.png -------------------------------------------------------------------------------- /www/public/img/snowpack-dev-startup-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-dev-startup-2.png -------------------------------------------------------------------------------- /www/public/img/snowpack-dev-startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-dev-startup.png -------------------------------------------------------------------------------- /www/public/img/snowpack-logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-logo-black.png -------------------------------------------------------------------------------- /www/public/img/snowpack-logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-logo-dark.png -------------------------------------------------------------------------------- /www/public/img/snowpack-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-logo-white.png -------------------------------------------------------------------------------- /www/public/img/snowpack-unbundled-example-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-unbundled-example-2.png -------------------------------------------------------------------------------- /www/public/img/snowpack-unbundled-example-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-unbundled-example-3.png -------------------------------------------------------------------------------- /www/public/img/snowpack-unbundled-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-unbundled-example.png -------------------------------------------------------------------------------- /www/public/img/snowpack-wordmark-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-wordmark-black.png -------------------------------------------------------------------------------- /www/public/img/snowpack-wordmark-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpack-wordmark-white.png -------------------------------------------------------------------------------- /www/public/img/snowpackskypack.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpackskypack.mp4 -------------------------------------------------------------------------------- /www/public/img/snowpackskypack.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/snowpackskypack.webm -------------------------------------------------------------------------------- /www/public/img/social-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/social-2.jpg -------------------------------------------------------------------------------- /www/public/img/social-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/social-2.png -------------------------------------------------------------------------------- /www/public/img/social-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/social-3.jpg -------------------------------------------------------------------------------- /www/public/img/social-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/social-4.jpg -------------------------------------------------------------------------------- /www/public/img/social-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/social-4.png -------------------------------------------------------------------------------- /www/public/img/social-snowpackv3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/social-snowpackv3.jpg -------------------------------------------------------------------------------- /www/public/img/social.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/social.jpg -------------------------------------------------------------------------------- /www/public/img/stat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/stat.jpg -------------------------------------------------------------------------------- /www/public/img/streaming-imports-demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/streaming-imports-demo.mp4 -------------------------------------------------------------------------------- /www/public/img/streaming-imports-demo.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/streaming-imports-demo.webm -------------------------------------------------------------------------------- /www/public/img/svelte-ts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/svelte-ts.png -------------------------------------------------------------------------------- /www/public/img/treeshaking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FredKSchott/snowpack/7f9b5455683a9d7632dbd7f4ed6db9ec2bb7c760/www/public/img/treeshaking.jpg -------------------------------------------------------------------------------- /www/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /www/public/styles/_globals.scss: -------------------------------------------------------------------------------- 1 | @use './var' as *; 2 | 3 | body { 4 | min-height: 100vh; 5 | } 6 | 7 | html, 8 | body { 9 | margin: 0; 10 | font-family: $body; 11 | } 12 | 13 | * { 14 | box-sizing: border-box; 15 | } 16 | 17 | img, 18 | video { 19 | max-width: 100%; 20 | height: auto; 21 | } 22 | 23 | p { 24 | line-height: 1.3; 25 | } 26 | 27 | pre { 28 | max-width: calc(100vw - 4rem); 29 | } 30 | 31 | .pretty-font, 32 | .version-number { 33 | font-weight: 600; 34 | font-family: $heading; 35 | } 36 | 37 | body.is-nav-open { 38 | height: 100%; 39 | overflow: hidden; 40 | } 41 | -------------------------------------------------------------------------------- /www/public/styles/global.scss: -------------------------------------------------------------------------------- 1 | @use './_github-markdown'; 2 | @use './_prism'; 3 | @use './_card-grid'; 4 | @use './_globals'; 5 | @use './_typography'; 6 | @use './utils'; 7 | -------------------------------------------------------------------------------- /www/src/components/Banner.astro: -------------------------------------------------------------------------------- 1 | 14 | 15 |
16 |
17 |
18 | Snowpack 3.0 is out now! 19 | 20 | Read the announcement post → 21 | 22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /www/src/components/CompanyLogo.jsx: -------------------------------------------------------------------------------- 1 | import { h } from 'preact'; 2 | 3 | export default function CompanyLogo({ user }) { 4 | return ( 5 | 6 | {user.img ? ( 7 | 8 | ) : ( 9 | {user.name} 10 | )} 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /www/src/components/NewsAssets.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |

Assets

7 | 8 | -------------------------------------------------------------------------------- /www/src/components/NewsTitle.vue: -------------------------------------------------------------------------------- 1 | 6 | 16 | -------------------------------------------------------------------------------- /www/src/components/PokemonLookup.astro: -------------------------------------------------------------------------------- 1 | --- 2 | let { number } = Astro.props; 3 | 4 | const pokemonDataReq = await fetch(`https://pokeapi.co/api/v2/pokemon/${number}`); 5 | const pokemonData = await pokemonDataReq.json(); 6 | --- 7 | 8 | 13 | 14 |
15 |
16 | Pokemon #{number} is: {pokemonData.name} 17 |
18 |
19 | -------------------------------------------------------------------------------- /www/src/components/index.ts: -------------------------------------------------------------------------------- 1 | console.log('Hello world!'); 2 | -------------------------------------------------------------------------------- /www/src/pages/404.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import BaseHead from '../components/BaseHead.astro'; 3 | import MainLayout from '../components/MainLayout.astro'; 4 | 5 | let title = 'Not Found'; 6 | let description = 'Snowpack is a lightning-fast frontend build tool, designed for the modern web.'; 7 | --- 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

19 | {title} 20 |

21 |
22 | Go Home 23 |
24 |
25 | 26 | 27 | --------------------------------------------------------------------------------