val-loader: ES2015 modules does not supported by current node.js, but present in dist

node.js: 7.7.3

dist unsupported code

import path from 'path';
import loaderUtils from 'loader-utils';

...

export default valLoader;
C:\12341234>npm i val-loader
C:\12341234
`-- val-loader@1.0.0
  `-- loader-utils@1.1.0
    +-- big.js@3.1.3
    +-- emojis-list@2.1.0
    `-- json5@0.5.1

npm WARN enoent ENOENT: no such file or directory, open 'C:\12341234\package.json'
npm WARN 12341234 No description
npm WARN 12341234 No repository field.
npm WARN 12341234 No README data
npm WARN 12341234 No license field.

C:\12341234>node
> require("val-loader")
C:\12341234\node_modules\val-loader\dist\index.js:1
(function (exports, require, module, __filename, __dirname) { import path from 'path';
                                                              ^^^^^^
SyntaxError: Unexpected token import


C:\12341234>node -v
v7.7.3

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@michael-ciniawsky Current webpack-defaults is correct but the cjs.js tweak didn’t make it into the PR for some reason.