Giter VIP home page Giter VIP logo

Comments (6)

HassanZahirnia avatar HassanZahirnia commented on May 30, 2024 1

@HassanZahirnia Would you provide a reproduction and open a new issue? 🙏 I can't reproduce it with a Vite 3 project following the instructions in the README.

Here #11

from magic-regexp.

danielroe avatar danielroe commented on May 30, 2024

Absolutely! I've added some more docs in the README for now: 45cba26. What do you think is particularly missing at the moment? Examples?

from magic-regexp.

HassanZahirnia avatar HassanZahirnia commented on May 30, 2024

@danielroe Thanks for your work! I would like to know how to use this in a project ? I tried to use it but got errors in my Laravel+Vite+Vue project:

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/hassan/project/node_modules/.pnpm/[email protected][email protected]/node_modules/magic-regexp/dist/transform.mjs not supported.

Does this tool only work in specific environment ?

from magic-regexp.

danielroe avatar danielroe commented on May 30, 2024

@HassanZahirnia Currently you can only import it in an ESM context. What does your vite config look like? Is it written in CJS or ESM?

from magic-regexp.

HassanZahirnia avatar HassanZahirnia commented on May 30, 2024

@HassanZahirnia Currently you can only import it in an ESM context. What does your vite config look like? Is it written in CJS or ESM?

I believe it's ESM

Here is a portion of my vite.config.ts:

import { defineConfig } from 'vite'
import laravel, { callArtisan, findPhpPath } from 'vite-plugin-laravel'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import inertiaLayout from './resources/js/inertia/layout'
import DefineOptions from 'unplugin-vue-define-options/vite'

export default defineConfig({
    optimizeDeps: {
        include: [
            // ... omitted for cleaner example
        ]
    },
    plugins: [
        AutoImport({
             // ... omitted for cleaner example
        }),
        inertiaLayout(),
        vue(),
        DefineOptions(),
        // ... omitted for cleaner example

from magic-regexp.

danielroe avatar danielroe commented on May 30, 2024

@HassanZahirnia Would you provide a reproduction and open a new issue? 🙏 I can't reproduce it with a Vite 3 project following the instructions in the README.

from magic-regexp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.