This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Description
Context: webpack-contrib/file-loader#130 (comment)
If webpack packages use import/export semantics and don't transpile, we'll end up with issues like this:
file-loader [feat-webpack-defaults] $ npm run build
> [email protected] prebuild .../file-loader
> yarn run clean:dist
yarn run v0.20.3
$ del-cli dist
✨ Done in 0.50s.
> [email protected] build .../file-loader
> cross-env NODE_ENV=production babel -s true src -d dist --ignore 'src/**/*.test.js'
src/index.js -> dist/index.js
file-loader [feat-webpack-defaults] $ node
> require('./')
.../file-loader/dist/index.js:5
import loaderUtils from 'loader-utils';
^^^^^^
SyntaxError: Unexpected token import
The problem is that if we do export default something, then that will lead to the .default issue with CommonJS environments.
Any ideas on a clean way to handle this? Maybe packages should use ES6 style internally and expose their public API through a CommonJS module.exports?