diff --git a/packages/builder/rollup.config.js b/packages/builder/rollup.config.js deleted file mode 100644 index 2f55c45fbc..0000000000 --- a/packages/builder/rollup.config.js +++ /dev/null @@ -1,138 +0,0 @@ -import alias from "@rollup/plugin-alias" -import svelte from "rollup-plugin-svelte" -import resolve from "rollup-plugin-node-resolve" -import commonjs from "@rollup/plugin-commonjs" -import url from "rollup-plugin-url" -import livereload from "rollup-plugin-livereload" -import { terser } from "rollup-plugin-terser" -import builtins from "rollup-plugin-node-builtins" -import nodeglobals from "rollup-plugin-node-globals" -import copy from "rollup-plugin-copy" -import css from "rollup-plugin-css-only" -import replace from "rollup-plugin-replace" -import json from "@rollup/plugin-json" -import html from "rollup-plugin-html" - -import path from "path" - -const production = !process.env.ROLLUP_WATCH -const outputpath = "../server/builder" -const coreExternal = [ - "lodash", - "lodash/fp", - "date-fns", - "lunr", - "safe-buffer", - "shortid", - "@nx-js/compiler-util", -] - -const customResolver = resolve({ - extensions: [ - ".mjs", - ".js", - ".jsx", - ".json", - ".sass", - ".scss", - ".svelte", - ".css", - ], -}) -const projectRootDir = path.resolve(__dirname) - -export default { - input: "src/main.js", - output: { - sourcemap: true, - format: "iife", - name: "app", - file: `${outputpath}/bundle.js`, - }, - plugins: [ - alias({ - entries: [ - { - find: "components", - replacement: path.resolve(projectRootDir, "src/components"), - }, - { - find: "builderStore", - replacement: path.resolve(projectRootDir, "src/builderStore"), - }, - { - find: "constants", - replacement: path.resolve(projectRootDir, "src/constants"), - }, - { - find: "analytics", - replacement: path.resolve(projectRootDir, "src/analytics"), - }, - ], - customResolver, - }), - copy({ - targets: [ - { src: "src/index.html", dest: outputpath }, - { src: "src/favicon.png", dest: outputpath }, - { src: "assets", dest: outputpath }, - { - src: "../bbui/dist/bbui.css", - dest: outputpath, - }, - { - src: "node_modules/remixicon/fonts/*", - dest: outputpath, - }, - ], - }), - - replace({ - "process.env.NODE_ENV": JSON.stringify( - production ? "production" : "development" - ), - "process.env.POSTHOG_TOKEN": JSON.stringify(process.env.POSTHOG_TOKEN), - "process.env.POSTHOG_URL": JSON.stringify(process.env.POSTHOG_URL), - "process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN), - }), - - svelte(), - - // Export all CSS imported in the JS to it's own bundle. - // This is exclusively external stylesheets and vendor stylesheets. - // Svelte CSS is handled by the svelte plugin - css({ - output: `external.css`, - }), - - resolve({ - browser: true, - dedupe: importee => { - return ( - importee === "svelte" || - importee.startsWith("svelte/") || - coreExternal.includes(importee) - ) - }, - }), - commonjs(), - url({ - limit: 0, - include: ["**/*.woff2", "**/*.png"], - fileName: "[dirname][name][extname]", - emitFiles: true, - }), - builtins(), - nodeglobals(), - - // Watch the `dist` directory and refresh the - // browser on changes when not in production - !production && livereload({ watch: outputpath, delay: 500, port: 35730 }), - - // If we're building for production (npm run build - // instead of npm run dev), minify - production && terser(), - json(), - html(), - ], -} diff --git a/packages/builder/src/components/design/AppPreview/iframeTemplate.html b/packages/builder/src/components/design/AppPreview/iframeTemplate.html deleted file mode 100644 index 166a978d01..0000000000 --- a/packages/builder/src/components/design/AppPreview/iframeTemplate.html +++ /dev/null @@ -1,46 +0,0 @@ - -
- - - - - - - - - \ No newline at end of file diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 69efc0820c..3c29eed5fe 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -35,7 +35,6 @@ "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-polyfill-node": "^0.6.2", "rollup-plugin-terser": "^7.0.2", "typescript": "^4.1.3" }, diff --git a/packages/string-templates/rollup.config.js b/packages/string-templates/rollup.config.js index 5cb296a1e9..a8fd48730f 100644 --- a/packages/string-templates/rollup.config.js +++ b/packages/string-templates/rollup.config.js @@ -2,7 +2,8 @@ import commonjs from "@rollup/plugin-commonjs" import resolve from "rollup-plugin-node-resolve" import json from "@rollup/plugin-json" import { terser } from "rollup-plugin-terser" -import nodePolyfills from "rollup-plugin-polyfill-node" +import builtins from "rollup-plugin-node-builtins" +import globals from "rollup-plugin-node-globals" const production = !process.env.ROLLUP_WATCH @@ -12,7 +13,8 @@ const plugins = [ preferBuiltins: true, }), commonjs(), - nodePolyfills(), + builtins(), + globals(), production && terser(), json(), ]