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

Something like "appendTsSuffixTo" for Vuejs #356

Open
dmitrykurmanov opened this Issue Jan 24, 2017 · 15 comments

Comments

Projects
None yet
@dmitrykurmanov

dmitrykurmanov commented Jan 24, 2017

Hello! Thanks for your work! In vuejs we have .vue files. So in ts-loader we have "appendTsSuffixTo" for that. What about something like that in atl ?

@Cyken-Zeraux

This comment has been minimized.

Show comment
Hide comment

Cyken-Zeraux commented Jan 26, 2017

@KhraksMamtsov

This comment has been minimized.

Show comment
Hide comment
@KhraksMamtsov

KhraksMamtsov Mar 18, 2017

Yes, it will be good feature. Now TS don't support importing *.vue files (Can't find module error).
And hack with suffixing *.vue with ".ts" at compile-time is way what use ts-loader. But ts-loader anyway generate error message and sequence ts-loader(target es6) -> babel-loader don't work.

So if you will implement this feature please keep in mind. Thanx

KhraksMamtsov commented Mar 18, 2017

Yes, it will be good feature. Now TS don't support importing *.vue files (Can't find module error).
And hack with suffixing *.vue with ".ts" at compile-time is way what use ts-loader. But ts-loader anyway generate error message and sequence ts-loader(target es6) -> babel-loader don't work.

So if you will implement this feature please keep in mind. Thanx

@Adam-Meisen

This comment has been minimized.

Show comment
Hide comment
@Adam-Meisen

Adam-Meisen Jun 1, 2017

Hey, I forked the repo and added this. I'll make a PR after doing some more work on it. https://github.com/Adam-Meisen/awesome-typescript-loader/

EDIT: Oh, if you try it out, just be aware that the config option has to be an array of strings, not RegExp objects. Example usage:

// after cloning and installing the repo, make sure you build it with 'npm run build'
{
  test: /\.vue$/,
  loader: 'vue-loader',
  options: {
    loaders: {
      ts: {
        // put the path (relative or absolute) to the cloned repo below
        loader: path.resolve(__dirname, '../awesome-typescript-loader/dist/index.js'), 
        options: {
          appendTsSuffixTo: ['\\.vue$'],
        },
      },
    },
    esModule: true,
  },

Adam-Meisen commented Jun 1, 2017

Hey, I forked the repo and added this. I'll make a PR after doing some more work on it. https://github.com/Adam-Meisen/awesome-typescript-loader/

EDIT: Oh, if you try it out, just be aware that the config option has to be an array of strings, not RegExp objects. Example usage:

// after cloning and installing the repo, make sure you build it with 'npm run build'
{
  test: /\.vue$/,
  loader: 'vue-loader',
  options: {
    loaders: {
      ts: {
        // put the path (relative or absolute) to the cloned repo below
        loader: path.resolve(__dirname, '../awesome-typescript-loader/dist/index.js'), 
        options: {
          appendTsSuffixTo: ['\\.vue$'],
        },
      },
    },
    esModule: true,
  },

@holiber

This comment has been minimized.

Show comment
Hide comment
@holiber

holiber commented Sep 11, 2017

@Adam-Meisen any update?

@Adam-Meisen

This comment has been minimized.

Show comment
Hide comment
@Adam-Meisen

Adam-Meisen Sep 17, 2017

Adam-Meisen commented Sep 17, 2017

@wendel841

This comment has been minimized.

Show comment
Hide comment
@wendel841

wendel841 Oct 10, 2017

+1 for this issue. Can this be resolved in the same way that ts-loader do?

wendel841 commented Oct 10, 2017

+1 for this issue. Can this be resolved in the same way that ts-loader do?

@cnnblike

This comment has been minimized.

Show comment
Hide comment
@cnnblike

cnnblike Feb 11, 2018

+1 for this issue. I love the awesome-ts-loader, but it seems like it's a necessity for typescript to use with vuejs. I'm using ts-loader instead at this time point.

cnnblike commented Feb 11, 2018

+1 for this issue. I love the awesome-ts-loader, but it seems like it's a necessity for typescript to use with vuejs. I'm using ts-loader instead at this time point.

@RehanSaeed

This comment has been minimized.

Show comment
Hide comment
@RehanSaeed

RehanSaeed Feb 12, 2018

Also using ts-loader in the mean time which is slow. Tried to use fork-ts-checker-webpack-plugin to speed it up but it has problems with imports and having to use tsconfig.json to tell it which files to transpile goes against the principles of how Webpack is supposed to work.

RehanSaeed commented Feb 12, 2018

Also using ts-loader in the mean time which is slow. Tried to use fork-ts-checker-webpack-plugin to speed it up but it has problems with imports and having to use tsconfig.json to tell it which files to transpile goes against the principles of how Webpack is supposed to work.

@roszell

This comment has been minimized.

Show comment
Hide comment
@roszell

roszell Mar 15, 2018

Any luck? Would like to go back to awesome-ts-loader instead of ts-loader to load .vue typescript files.

roszell commented Mar 15, 2018

Any luck? Would like to go back to awesome-ts-loader instead of ts-loader to load .vue typescript files.

@thomthom

This comment has been minimized.

Show comment
Hide comment
@thomthom

thomthom Jun 8, 2018

@KhraksMamtsov - I'm also looking to use webpack with .vue files with TypeScript, with a target of ES5. But I struggle to find a solution. Sounds like you had similar challenge - did you find a solution?

thomthom commented Jun 8, 2018

@KhraksMamtsov - I'm also looking to use webpack with .vue files with TypeScript, with a target of ES5. But I struggle to find a solution. Sounds like you had similar challenge - did you find a solution?

@odrozd

This comment has been minimized.

Show comment
Hide comment
@odrozd

odrozd Jun 8, 2018

@thomthom I've successfuly using VUE + TypeScript + Webpack + ES5, but with ts-loader. If you need tip just let me know.

odrozd commented Jun 8, 2018

@thomthom I've successfuly using VUE + TypeScript + Webpack + ES5, but with ts-loader. If you need tip just let me know.

@thomthom

This comment has been minimized.

Show comment
Hide comment
@thomthom

thomthom Jun 8, 2018

@odrozd In combo with .vue single file components? If so, I'd love to hear about your setup!

thomthom commented Jun 8, 2018

@odrozd In combo with .vue single file components? If so, I'd love to hear about your setup!

@odrozd

This comment has been minimized.

Show comment
Hide comment
@odrozd

odrozd Jun 8, 2018

@thomthom confirmed it works with single file components. For IDE intellisense I use vue-class-component decorator. But in the end components works as expected

odrozd commented Jun 8, 2018

@thomthom confirmed it works with single file components. For IDE intellisense I use vue-class-component decorator. But in the end components works as expected

@thomthom

This comment has been minimized.

Show comment
Hide comment
@thomthom

thomthom Jun 8, 2018

@odrozd I'd love to hear more, but maybe we should take this to a separate discussion? (I have already started one on a forum: https://laracasts.com/discuss/channels/vue/webpack-vue-typescript-es5)

thomthom commented Jun 8, 2018

@odrozd I'd love to hear more, but maybe we should take this to a separate discussion? (I have already started one on a forum: https://laracasts.com/discuss/channels/vue/webpack-vue-typescript-es5)

@odrozd

This comment has been minimized.

Show comment
Hide comment
@odrozd

odrozd Jun 8, 2018

@thomthom I dont have an account on that forum discussion, so I will leave it here: you can use this repo as a template: https://github.com/Microsoft/TypeScript-Vue-Starter I have almost the same only with some different libraries versions

odrozd commented Jun 8, 2018

@thomthom I dont have an account on that forum discussion, so I will leave it here: you can use this repo as a template: https://github.com/Microsoft/TypeScript-Vue-Starter I have almost the same only with some different libraries versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment