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

Support for relative imports #12

Closed
anish2690 opened this issue Jun 18, 2020 · 26 comments
Closed

Support for relative imports #12

anish2690 opened this issue Jun 18, 2020 · 26 comments

Comments

@anish2690
Copy link
Contributor

example '@/views/Test.vue'

@lzxb
Copy link
Contributor

lzxb commented Jun 18, 2020

const ssr = new SSR({
    build: {
        alias: {
            '@': path.resolve(__dirname, './src')
        }
    }
});

@lzxb
Copy link
Contributor

lzxb commented Jun 18, 2020

I'm curious how you found Genesis

@anish2690
Copy link
Contributor Author

@anish2690
Copy link
Contributor Author

const ssr = new SSR({
    build: {
        alias: {
            '@': path.resolve(__dirname, './src')
        }
    }
});

image
@lzxb It works perfectly, only one problem found was an eslint warning.

@lzxb
Copy link
Contributor

lzxb commented Jun 20, 2020

You need to use this eslint plug-in

https://www.npmjs.com/package/eslint-import-resolver-custom-alias

@anish2690
Copy link
Contributor Author

anish2690 commented Jun 21, 2020

@lzxb I have tried but it took warning from vscode but lint check failed
image
and found that @fmfe/genesis-lint already pre-shipped with eslint-import-resolver-custom-alias is there is here ?.

@lzxb
Copy link
Contributor

lzxb commented Jun 21, 2020

The alias of @fmfe/genesis-lint is package.json name by default

@lzxb
Copy link
Contributor

lzxb commented Jun 21, 2020

@anish2690
Copy link
Contributor Author

anish2690 commented Jun 21, 2020

Got it, thanks @lzxb.

this one worked

module.exports = {
    extends: [
        require.resolve('@fmfe/genesis-lint'),
    ],
    settings: {
        'import/resolver': {
            'eslint-import-resolver-custom-alias': {
                alias:{
                    '@':'./src'
                },
                extensions: ['.js', 'jsx', '.vue', '.ts', 'tsx'],
                "packages": [
                    "examples/*"
                ]
            },
        }
    }
}

@lzxb
Copy link
Contributor

lzxb commented Jun 21, 2020

Good work

@anish2690
Copy link
Contributor Author

anish2690 commented Jun 21, 2020

@lzxb there is any discord channel or forum for discussions? I would like to contribute some of my efforts to this project.

@lzxb
Copy link
Contributor

lzxb commented Jun 21, 2020

There is no forum to discuss at present, but you can write a technical article to share it

@lzxb
Copy link
Contributor

lzxb commented Jun 21, 2020

Limited energy at present, unable to provide English documents for the time being

@anish2690
Copy link
Contributor Author

@lzxb there is anyway to touch base with you other than GitHub, private slack channel will be helpful.

@lzxb
Copy link
Contributor

lzxb commented Jun 22, 2020

Do you see telegram ?

@anish2690
Copy link
Contributor Author

@lzxb yes telegram work for me. try @anish2690

@lzxb
Copy link
Contributor

lzxb commented Jun 22, 2020

Let me try

@anish2690
Copy link
Contributor Author

@lzxb did you able to find me ?

@lzxb
Copy link
Contributor

lzxb commented Jun 22, 2020

image
You to find me @lzxb

@anish2690
Copy link
Contributor Author

@lzxb, so weird are you there in this list
image

@anish2690
Copy link
Contributor Author

@lzxb is this you email 1340641314@qq.com i will sent my phone no to you.

@lzxb
Copy link
Contributor

lzxb commented Jun 23, 2020

Yes

@anish2690
Copy link
Contributor Author

@lzxb done, let me know .

@lzxb
Copy link
Contributor

lzxb commented Jun 23, 2020

I added it, but I can't send you a message

@anish2690
Copy link
Contributor Author

@lzxb can you sent back your contact phone no ?

@lzxb
Copy link
Contributor

lzxb commented Jun 23, 2020

It has been sent to your email

@lzxb lzxb closed this as completed Jun 24, 2020
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

2 participants