cfware / babel-plugin-template-html-minifier

Minify HTML in tagged template strings using html-minifier
MIT License
63 stars 4 forks source link

Cannot find module '*/package.json' when using with webpack and resolve aliases #4

Closed marcin-serwin closed 5 years ago

marcin-serwin commented 6 years ago

Webpack has an option to affect how the resolving is done. For example, one can set alias Utilities: path.resolve(__dirname, 'src/utilities/') and then write import something from "Utilities/something.js". The plugin will, however, complain that it cannot find module Utilities, which makes this feature unusable with it.

I think simply ignoring case when a module does not exist would solve the issue.

coreyfarrell commented 6 years ago

@Toxyxer could you give #5 a try to be sure I haven't missed anything? Thanks!

marcin-serwin commented 5 years ago

@coreyfarrell Works in my case.