Closed ghost closed 8 years ago
Next release is written with webpack and will expose darkroom as a valid npm module. See #79.
For future reference, here's how I got Darkroom v2 to work with webpack:
yarn add exports-loader --dev
(or npm, whichever you like)
resolve: {
alias: {
darkroom: 'darkroom/lib/js/core/darkroom',
},
},
module: {
loaders: [{
include: require.resolve('darkroom/lib/js/core/darkroom'),
loader: 'exports?window.Darkroom',
}],
},
Now I am able to import Darkroom from 'darkroom';
in my component. require
should work as well.
Whoops, spoke too soon. The package doesn't currently build on install. Would be great to see v3, but for now I'm just going to look for another package.
I am using nodejs and webpack, and problem appears when i am trying to include Darkroom like
var Darkroom = require('darkroom');
Node js and Webpack can not find this module in
node_modules
, what i am doing wrong?