Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rollup-plugin-dynamic-import-variables] Unexpected token (3:7) #5

Open
FezVrasta opened this issue Nov 19, 2021 · 0 comments
Open

Comments

@FezVrasta
Copy link

FezVrasta commented Nov 19, 2021

I get the error in the title when I run yarn build with the below config:

// vite.config.js
import path from "path";
import { defineConfig } from "vite";
import { flowPlugin, esbuildFlowPlugin } from "@bunchtogether/vite-plugin-flow";

module.exports = defineConfig({
  optimizeDeps: {
    esbuildOptions: {
      plugins: [esbuildFlowPlugin()],
    },
  },
  plugins: [flowPlugin()],
  build: {
    lib: {
      entry: require.resolve("./lib/index.js"),
      name: "Popper",
      fileName: (format) => `popper-core.${format}.js`,
    },
  },
});

The code that throws is (lib/index.js):

/* eslint-disable import/no-unused-modules */
// @flow
export type * from './types';

export { position } from './position';
export { auto } from './modifiers/auto';
export { shift, limitShift } from './modifiers/shift';
export { flip } from './modifiers/flip';
export { arrow } from './modifiers/arrow';
export { offset } from './modifiers/offset';
export { hide } from './modifiers/hide';
export { size } from './modifiers/size';

export { default as rectToClientRect } from './utils/rectToClientRect';

This is my package.json:

{
  "name": "@popperjs/core",
  "version": "3.0.0-alpha.0",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "serve": "vite preview"
  },
  "devDependencies": {
    "@bunchtogether/vite-plugin-flow": "^1.0.1",
    "flow-bin": "^0.165.0",
    "vite": "^2.6.4"
  }
}

I also have the same problem if I get rid of the build config and use the more basic config mode.

Ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant