From 5b8e4fce2ae45a3663922089d1fab8f027e2fa3d Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Thu, 1 Oct 2020 20:24:13 -0700 Subject: [PATCH] remove babel syntax plugin no longer needed --- .../app-scripts-preact/babel.config.json | 1 - .../app-scripts-preact/jest/babelTransform.js | 1 - .../app-scripts-preact/package.json | 1 - .../app-template-preact/babel.config.json | 1 - .../app-template-preact/package.json | 1 - .../package.json | 1 - .../app-template-react/package.json | 1 - snowpack/package.json | 1 - .../create-snowpack-app.test.js.snap | 62 +++++++++---------- 9 files changed, 30 insertions(+), 40 deletions(-) diff --git a/create-snowpack-app/app-scripts-preact/babel.config.json b/create-snowpack-app/app-scripts-preact/babel.config.json index 7df1c81db5..ac737ae536 100644 --- a/create-snowpack-app/app-scripts-preact/babel.config.json +++ b/create-snowpack-app/app-scripts-preact/babel.config.json @@ -14,7 +14,6 @@ } ] ], - "plugins": ["@babel/plugin-syntax-import-meta"], "env": { "development": { "plugins": ["@prefresh/babel-plugin"] diff --git a/create-snowpack-app/app-scripts-preact/jest/babelTransform.js b/create-snowpack-app/app-scripts-preact/jest/babelTransform.js index e2280d6e0d..8998663aac 100644 --- a/create-snowpack-app/app-scripts-preact/jest/babelTransform.js +++ b/create-snowpack-app/app-scripts-preact/jest/babelTransform.js @@ -33,5 +33,4 @@ module.exports = babelJest.createTransformer({ }, ], ], - plugins: ["@babel/plugin-syntax-import-meta"], }); diff --git a/create-snowpack-app/app-scripts-preact/package.json b/create-snowpack-app/app-scripts-preact/package.json index 05b66093e3..b812a19343 100644 --- a/create-snowpack-app/app-scripts-preact/package.json +++ b/create-snowpack-app/app-scripts-preact/package.json @@ -8,7 +8,6 @@ "license": "MIT", "dependencies": { "@babel/core": "^7.10.5", - "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-env": "^7.10.4", "@babel/preset-react": "^7.10.4", "@babel/preset-typescript": "^7.10.4", diff --git a/create-snowpack-app/app-template-preact/babel.config.json b/create-snowpack-app/app-template-preact/babel.config.json index 7df1c81db5..ac737ae536 100644 --- a/create-snowpack-app/app-template-preact/babel.config.json +++ b/create-snowpack-app/app-template-preact/babel.config.json @@ -14,7 +14,6 @@ } ] ], - "plugins": ["@babel/plugin-syntax-import-meta"], "env": { "development": { "plugins": ["@prefresh/babel-plugin"] diff --git a/create-snowpack-app/app-template-preact/package.json b/create-snowpack-app/app-template-preact/package.json index 2cf879128c..4e631cdcb5 100644 --- a/create-snowpack-app/app-template-preact/package.json +++ b/create-snowpack-app/app-template-preact/package.json @@ -19,7 +19,6 @@ "preact": "^10.4.6" }, "devDependencies": { - "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-env": "^7.10.4", "@babel/preset-react": "^7.10.4", "@prefresh/babel-plugin": "^0.1.0", diff --git a/create-snowpack-app/app-template-react-typescript/package.json b/create-snowpack-app/app-template-react-typescript/package.json index b08e446f8d..12b9f6617d 100644 --- a/create-snowpack-app/app-template-react-typescript/package.json +++ b/create-snowpack-app/app-template-react-typescript/package.json @@ -20,7 +20,6 @@ "react-dom": "^16.13.1" }, "devDependencies": { - "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-react": "^7.10.4", "@babel/preset-typescript": "^7.10.4", "@snowpack/app-scripts-react": "^1.11.0", diff --git a/create-snowpack-app/app-template-react/package.json b/create-snowpack-app/app-template-react/package.json index 31926976a1..6f2abbf89f 100644 --- a/create-snowpack-app/app-template-react/package.json +++ b/create-snowpack-app/app-template-react/package.json @@ -20,7 +20,6 @@ "react-dom": "^16.13.1" }, "devDependencies": { - "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-react": "^7.10.4", "@snowpack/app-scripts-react": "^1.11.0", "@snowpack/plugin-dotenv": "^2.0.1", diff --git a/snowpack/package.json b/snowpack/package.json index fd7fb576e5..e788aa8be6 100644 --- a/snowpack/package.json +++ b/snowpack/package.json @@ -25,7 +25,6 @@ "snowpack": "index.bin.js" }, "dependencies": { - "@babel/plugin-syntax-import-meta": "^7.10.4", "@snowpack/plugin-build-script": "^2.0.7", "@snowpack/plugin-run-script": "^2.1.3", "cacache": "^15.0.0", diff --git a/test/create-snowpack-app/__snapshots__/create-snowpack-app.test.js.snap b/test/create-snowpack-app/__snapshots__/create-snowpack-app.test.js.snap index b97f3b9004..3383f90b9e 100644 --- a/test/create-snowpack-app/__snapshots__/create-snowpack-app.test.js.snap +++ b/test/create-snowpack-app/__snapshots__/create-snowpack-app.test.js.snap @@ -7506,26 +7506,26 @@ document.head.appendChild(styleEl);" `; exports[`create-snowpack-app app-template-react: _dist_/App.js 1`] = ` -"import React, { useState } from '../web_modules/react.js'; -import logo from './logo.svg.proxy.js'; -import './App.css.proxy.js'; -function App() { - return /*#__PURE__*/React.createElement(\\"div\\", { +"import React, {useState} from \\"../web_modules/react.js\\"; +import logo2 from \\"./logo.svg.proxy.js\\"; +import \\"./App.css.proxy.js\\"; +function App2() { + return /* @__PURE__ */ React.createElement(\\"div\\", { className: \\"App\\" - }, /*#__PURE__*/React.createElement(\\"header\\", { + }, /* @__PURE__ */ React.createElement(\\"header\\", { className: \\"App-header\\" - }, /*#__PURE__*/React.createElement(\\"img\\", { - src: logo, + }, /* @__PURE__ */ React.createElement(\\"img\\", { + src: logo2, className: \\"App-logo\\", alt: \\"logo\\" - }), /*#__PURE__*/React.createElement(\\"p\\", null, \\"Edit \\", /*#__PURE__*/React.createElement(\\"code\\", null, \\"src/App.jsx\\"), \\" and save to reload.\\"), /*#__PURE__*/React.createElement(\\"a\\", { + }), /* @__PURE__ */ React.createElement(\\"p\\", null, \\"Edit \\", /* @__PURE__ */ React.createElement(\\"code\\", null, \\"src/App.jsx\\"), \\" and save to reload.\\"), /* @__PURE__ */ React.createElement(\\"a\\", { className: \\"App-link\\", href: \\"https://reactjs.org\\", target: \\"_blank\\", rel: \\"noopener noreferrer\\" }, \\"Learn React\\"))); } -export default App;" +export default App2;" `; exports[`create-snowpack-app app-template-react: _dist_/index.css 1`] = ` @@ -7556,12 +7556,11 @@ document.head.appendChild(styleEl);" exports[`create-snowpack-app app-template-react: _dist_/index.js 1`] = ` "import __SNOWPACK_ENV__ from '../__snowpack__/env.js'; import.meta.env = __SNOWPACK_ENV__; -import React from '../web_modules/react.js'; -import ReactDOM from '../web_modules/react-dom.js'; -import App from './App.js'; -import './index.css.proxy.js'; -ReactDOM.render( /*#__PURE__*/React.createElement(React.StrictMode, null, /*#__PURE__*/React.createElement(App, null)), document.getElementById('root')); // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. -// Learn more: https://www.snowpack.dev/#hot-module-replacement +import React from \\"../web_modules/react.js\\"; +import ReactDOM from \\"../web_modules/react-dom.js\\"; +import App2 from \\"./App.js\\"; +import \\"./index.css.proxy.js\\"; +ReactDOM.render(/* @__PURE__ */ React.createElement(React.StrictMode, null, /* @__PURE__ */ React.createElement(App2, null)), document.getElementById(\\"root\\")); if (import.meta.hot) { import.meta.hot.accept(); }" @@ -8021,26 +8020,26 @@ document.head.appendChild(styleEl);" `; exports[`create-snowpack-app app-template-react-typescript: _dist_/App.js 1`] = ` -"import React from '../web_modules/react.js'; -import logo from './logo.svg.proxy.js'; -import './App.css.proxy.js'; -function App({}) { - return /*#__PURE__*/React.createElement(\\"div\\", { +"import React from \\"../web_modules/react.js\\"; +import logo2 from \\"./logo.svg.proxy.js\\"; +import \\"./App.css.proxy.js\\"; +function App2({}) { + return /* @__PURE__ */ React.createElement(\\"div\\", { className: \\"App\\" - }, /*#__PURE__*/React.createElement(\\"header\\", { + }, /* @__PURE__ */ React.createElement(\\"header\\", { className: \\"App-header\\" - }, /*#__PURE__*/React.createElement(\\"img\\", { - src: logo, + }, /* @__PURE__ */ React.createElement(\\"img\\", { + src: logo2, className: \\"App-logo\\", alt: \\"logo\\" - }), /*#__PURE__*/React.createElement(\\"p\\", null, \\"Edit \\", /*#__PURE__*/React.createElement(\\"code\\", null, \\"src/App.tsx\\"), \\" and save to reload.\\"), /*#__PURE__*/React.createElement(\\"a\\", { + }), /* @__PURE__ */ React.createElement(\\"p\\", null, \\"Edit \\", /* @__PURE__ */ React.createElement(\\"code\\", null, \\"src/App.tsx\\"), \\" and save to reload.\\"), /* @__PURE__ */ React.createElement(\\"a\\", { className: \\"App-link\\", href: \\"https://reactjs.org\\", target: \\"_blank\\", rel: \\"noopener noreferrer\\" }, \\"Learn React\\"))); } -export default App;" +export default App2;" `; exports[`create-snowpack-app app-template-react-typescript: _dist_/index.css 1`] = ` @@ -8071,12 +8070,11 @@ document.head.appendChild(styleEl);" exports[`create-snowpack-app app-template-react-typescript: _dist_/index.js 1`] = ` "import __SNOWPACK_ENV__ from '../__snowpack__/env.js'; import.meta.env = __SNOWPACK_ENV__; -import React from '../web_modules/react.js'; -import ReactDOM from '../web_modules/react-dom.js'; -import App from './App.js'; -import './index.css.proxy.js'; -ReactDOM.render( /*#__PURE__*/React.createElement(React.StrictMode, null, /*#__PURE__*/React.createElement(App, null)), document.getElementById('root')); // Hot Module Replacement (HMR) - Remove this snippet to remove HMR. -// Learn more: https://www.snowpack.dev/#hot-module-replacement +import React from \\"../web_modules/react.js\\"; +import ReactDOM from \\"../web_modules/react-dom.js\\"; +import App2 from \\"./App.js\\"; +import \\"./index.css.proxy.js\\"; +ReactDOM.render(/* @__PURE__ */ React.createElement(React.StrictMode, null, /* @__PURE__ */ React.createElement(App2, null)), document.getElementById(\\"root\\")); if (import.meta.hot) { import.meta.hot.accept(); }"