Answer the question
In order to leave comments, you need to log in
How to include images from node_modules in local assembly?
Hello!
var webpackBaseConfig = {
devtool: 'eval-cheap-module-source-map',
entry: entry(),
output: {
filename: "[name].js",
path: path.resolve(__dirname, 'dist'),
libraryTarget: "amd"
},
module: {
loaders: [
{test: /\.ts?$/, exclude: /node_modules/, loader: 'es3ify!ts'},
{test: /\.(scss|css)(\?.+)?$/, loader: 'style-loader!css-loader!sass-loader?sourceMap'},
{test: /\.svg|ico|png|gif|jpg($|\?)/, loader: 'file?name=images/[name].[ext]'},
{test: /\.eot|ttf|woff|woff2($|\?)/, loader: 'file?name=fonts/[name].[ext]'}
]
},
...
resolve: {
root: path.resolve(__dirname, "src"),
alias: {
images: path.resolve("./node_modules/inner-module/build/images")
},
extensions: ["", ".js", ".ts", ".css", ".scss", ".png"]
},
.....
};
alias: {
images: path.resolve("../node_modules/inner-module/build/images")
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question