Flamme13 / uglify-template-string-loader

Removes spaces and line breaks in ES Template Strings.
MIT License
3 stars 0 forks source link

Error with lodash.js #1

Open andersforsell opened 5 years ago

andersforsell commented 5 years ago

Hello,

I am getting the following error:

ERROR in ./node_modules/lodash/lodash.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\git\ebitool-mint\mint-gwt-ui\src\main\webapp\node_modules\lodash\lodash.js: Unexpected token (4996:5)

4994 |
4995 | // Mimic the constructor's returnbehavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps func to enable currying.

4996 | *
| ^
4997 | * @Private
4998 | * @param {Function} func The function to wrap.
4999 | * @param {number} bitmask The bitmask flags. See createWrap for more details.
at Parser.raise (C:\git\ebitool-mint\mint-gwt-ui\src\main\webapp\node_modules@babel\parser\lib\index.js:6344:17)

lodash is version v4.17.11

My webpack.config.js:

const commonConfig = merge([
  {
    entry: './src/index.js',
    output: {
      path: OUTPUT_PATH,
      filename: '[name].[chunkhash:8].js'
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          // We need to transpile Polymer,so whitelist packages containing ES modules
          exclude: /node_modules\/(?!(@webcomponents\/shadycss|lit-html|@polymer|@vaadin)\/).*/,
          use: [
            {
              loader: 'babel-loader',
              options: {
                babelrc: true,
                extends: join(__dirname + '/.babelrc'),
                cacheDirectory: true,
                envName: ENV
              }
            },
            {
              loader: 'uglify-template-string-loader'
            }
          ]
        }
      ]
    }
  }

When I remove uglify-template-string-loader the error is gone.

Flamme13 commented 5 years ago

Hello,

I tried to reproduce the problem using the data that was provided by you.

I could not reproduce the problem.

Here is a link to the repository, where I tried to reproduce the problem. error-with-lodash

If possible, indicate the problem more precisely or solve the problem.

andersforsell commented 5 years ago

Thanks for looking into this. I created https://github.com/Flamme13/error-with-lodash/pull/1 which should trigger the problem.