I'm attempting to bring in a package and utilize it within my Vue application like so:
import ExternalSamplePackage from 'external-sample-package'
export default {
directives: {
ExternalSamplePackage
}
}
Since I am in SSR mode, I want to conditionally import the package in this manner:
if(process.client) {
import ExternalSamplePackage from 'external-sample-package'
}
However, when I do this, I encounter the following error with es-lint:
> error Parsing error: 'import' and 'export' may only appear at the top level
Is there a way for me to properly import while adhering to the correct es-linting rules?