New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UMD built from webpack 4 can not be imported by webpack 2 #6617

Closed
njleonzhang opened this Issue Feb 28, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@njleonzhang

njleonzhang commented Feb 28, 2018

Do you want to request a feature or report a bug?
bug

What is the current behavior?
UMD built from webpack 4 can not be imported by webpack 2

If the current behavior is a bug, please provide the steps to reproduce.
look at this project, I currently build the project as cmd. It now can be loaded correctly in webpack 3 project. But if I change the libraryTarget to umd, the generated lib can not be load by webpack 3. (generated umd can be loaded by webpack 4)

  output: {
    filename: "./index.js",
    libraryTarget: "commonjs"
    // libraryTarget: "umd"
  },

When I use the generated umd in webpack 3, it runs in to the following error:

"export 'CachedStorage' was not found in 'web-cached-persistence'

What is the expected behavior?
no error should be emitted.

@lilijialiang

This comment has been minimized.

lilijialiang commented Mar 12, 2018

I also encountered a similar problem.

// test.js
export default { a ( ) { console.log( 'a' ) }  }
// webpack.config.js
output: {
    library: 'TEST',
    libraryTarget: 'umd',
    filename: '[name].min.js',
    path: path.resolve( __dirname, '../dist' ),
},
window.TEST.a  // undefined

webpack@4.1.1

@webpack-bot

This comment has been minimized.

webpack-bot commented Sep 10, 2018

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@webpack-bot

This comment has been minimized.

webpack-bot commented Sep 25, 2018

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment