Skip to content

Instantly share code, notes, and snippets.

@jeremiegirault
Created November 24, 2017 18:39
Show Gist options
  • Save jeremiegirault/5c20cf51d79c737a09b8d370803622d1 to your computer and use it in GitHub Desktop.
Save jeremiegirault/5c20cf51d79c737a09b8d370803622d1 to your computer and use it in GitHub Desktop.
Webpack hoisting issue
import m1 from './module1'
import m2 from './module2'
console.log('module1:', m1.id, ' - module2:', m2.id)
export default { id: module.id }
export default { id: module.id }
const webpack = require('webpack')
module.exports = {
entry: './main.js',
output: {
filename: 'main.out.js'
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
}
import m1 from './module1'
import m2 from './module2'
console.log('module1:', m1.id, ' - module2:', m2.id)
export default { id: module.id }
export default { id: module.id }
const webpack = require('webpack')
module.exports = {
entry: './main.js',
output: {
filename: 'main.out.js'
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment