Reputation: 233
I am trying to import the print.js library into the vendor bundle in my project using webpack. For some reason it cannot resolve the module. The print.js node_modules folder contains some interesting files - webpack.mix.js
and the src/index.js
appears to be written in ES6. Maybe I am missing a dependency or ES6 support?
my webpack.config.js
:
var webpack = require("webpack"),
path = require("path");
const Dotenv = require('dotenv-webpack');
module.exports = {
context: __dirname + "/public",
entry: {
app: "./application.js",
vendor: ["angular", "angular-route", "scrollreveal", "clipboard", "print.js"]
},
output: {
path: __dirname + "/public/scripts",
filename: "trails.bundle.js"
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({name: "vendor", filename: "vendor.bundle.js"}),
new Dotenv({
path: './.env', // Path to .env file (this is the default)
})
]
};
The error:
ERROR in multi angular angular-route scrollreveal clipboard print.js
Module not found: Error: Can't resolve 'print.js'
Upvotes: 0
Views: 1162
Reputation: 5186
The library was renamed to print-js
in npm.
Try:
...
entry: {
app: "./application.js",
vendor: ["angular", "angular-route", "scrollreveal", "clipboard", "print-js"]
},
...
Upvotes: 1