You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am in the process of migratring to rocket and came up with the following rocket.config.mjs file:
import{createSpaConfig}from'@rocket/building-rollup';import{absoluteBaseUrlNetlify}from'@rocket/core/helpers';import{rocketLaunch}from'@rocket/launch';import{copy}from'@web/rollup-plugin-copy';importautoprefixerfrom'autoprefixer';importcssnanofrom'cssnano';importmergefrom'deepmerge';import{addPlugin,adjustPluginOptions,}from'plugins-manager';importpostcssfrom'rollup-plugin-postcss';importsvgofrom'rollup-plugin-svgo';importvisualizerfrom'rollup-plugin-visualizer';constbaseConfig=createSpaConfig({absoluteBaseUrl: absoluteBaseUrlNetlify('http://localhost:8080'),// development mode creates a non-minified build for debugging or developmentdevelopmentMode: process.env.ROLLUP_WATCH==='true',// set to true to inject the service worker registration into your index.htmlinjectServiceWorker: false,// if you use createSpaConfig, you can use your index.html as entrypoint,// any <script type="module"> inside will be bundled by rollupinput: 'index.html',// alternatively, you can use your JS as entrypoint for rollup and// optionally set a HTML template manually// input: './app.js',// use the outputdir option to modify where files are outputoutput: {dir: 'build'},presets: [rocketLaunch()],});exportdefaultmerge(baseConfig,{output: {assetFileNames: 'assets/[name]-[hash][extname]',chunkFileNames: 'static/js/chunks/[name]-[hash].js',// TODO: rename to [hash].js before deploymentoutentryFileNames: 'static/js/[name]-[hash].js',format: 'es',},setupBuildPlugins: [addPlugin({name: 'copy',options: {patterns: 'assets/css/**/*'},plugin: copy,}),addPlugin({name: 'postcss',options: {extract: true,plugin: [autoprefixer(),cssnano()],},plugin: postcss,}),addPlugin({name: 'svgo',options: {// See https://github.com/svg/svgo#what-it-can-doremoveAttributesBySelector: true,removeOffCanvasPaths: true,removeRasterImages: true,reusePaths: true,sortAttrs: true,},plugin: svgo,}),addPlugin({name: 'visualizer',options: {brotliSize: true,gzipSize: true,template: 'treemap',},plugin: visualizer,}),adjustPluginOptions('importMetaAssets',{transform: (assetBuffer,assetPath)=>{returnassetPath.endsWith('.svg')
? svgo.optimize(assetBuffer.toString()).then(({ data })=>data)
: assetBuffer;},}),// workaround for development vs build relative pathsadjustPluginOptions('html',{transform: (html)=>html.replace(/href="\.\/public\//g,'href="./'),}),],});
When trying to build the project using rimraf build && tsc && rocket -c rocket.config.mjs I am getting the following error message:
yarn build
yarn run v1.22.5
$ rimraf build && tsc && rocket -c rocket.config.mjs
(node:23104) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'includes' of undefined
at RocketCli.considerPlugin (file:///C:/Users/ateyar/Documents/GitHub/x-wc/node_modules/@rocket/cli/src/RocketCli.js:188:28)
at RocketCli.run (file:///C:/Users/ateyar/Documents/GitHub/x-wc/node_modules/@rocket/cli/src/RocketCli.js:145:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:23104) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23104) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 10.61s.
I went through the doc couples of times but can't figure out why I am getting that. Could you please advise on how to make this work, and ways I could improve this config?
The text was updated successfully, but these errors were encountered:
I am in the process of migratring to rocket and came up with the following
rocket.config.mjs
file:When trying to build the project using
rimraf build && tsc && rocket -c rocket.config.mjs
I am getting the following error message:I went through the doc couples of times but can't figure out why I am getting that. Could you please advise on how to make this work, and ways I could improve this config?
The text was updated successfully, but these errors were encountered: