Giter Site home page Giter Site logo

Comments (5)

fathyb avatar fathyb commented on June 10, 2024 1

Hey @lc60005457, I'm the maintainer of the TypeScript plugin and I'm still trying to figure out why is this happening, do you think it crashes because I override some Parcel stuff? Thanks.

edit: nevermind I've just understand they are two different errors, I will implement the ts-loader behaviour as you said.

And you are right for the error, I extend Parcel but this should be fixed in the new plugin release where I don't touch Parcel at all. The workaround is to just add parcel-bundler to the dependencies for now.

from parcel-plugin-vue.

csvwolf avatar csvwolf commented on June 10, 2024 1

Thank you two @lc60005457 @fathyb . It works well now

from parcel-plugin-vue.

BoltDoggy avatar BoltDoggy commented on June 10, 2024

@csvwolf Maybe you need a tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "strict": true,
    "module": "es2015",
    "moduleResolution": "node"
  }
}

I find it in https://cn.vuejs.org/v2/guide/typescript.html

You should show your all code or repo url.

from parcel-plugin-vue.

csvwolf avatar csvwolf commented on June 10, 2024

Thank you for your response @lc60005457. I tried the tsconfig and not work.

Here is my repo for the problem: https://github.com/csvwolf/parcel-test

from parcel-plugin-vue.

BoltDoggy avatar BoltDoggy commented on June 10, 2024

@csvwolf See https://github.com/lc60005457/parcel-test (deleted)

I just add "dev": "rm -rf .cache && rm -rf dist && parcel index.html", in

  "scripts": {
    "dev": "rm -rf .cache && rm -rf dist && parcel index.html",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

to run npm run dev instead of run rm -rf .cache && rm -rf dist && parcel index.html

The Reason

I guess that the plugin for 'typescript' extended and overloaded the 'parcel', but the global parcel is not be overloaded.

In your dist code 'another-crayfish-lite.js' (Maybe 7535:0 maybe other)

},{"./app.vue":3,"vue":3}],0:[function(require,module,exports) {

The './app.vue' moduleId eq The 'vue' moduleId.

But my plugin for 'vue' works OK with ts(parcel official).

Other Error

And See https://github.com/lc60005457/parcel-vue-demo/tree/feature/plugin-typescript#used-with-parcel-plugin-typescript

The log show Cannot find module './index.vue'.

The Result of browser is OK!

It's that the plugin for 'typescript' can't find '*.vue'.

In 'ts-loader', that has a 'appendTsSuffixTo' option can used for '*.vue'.

More in https://github.com/TypeStrong/ts-loader#appendtsxsuffixto-regexp-default.

from parcel-plugin-vue.

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.