Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// we override module rules since we don't want file-loader to be triggered for inline SVGs
module: {
rules: baseConfig.module.rules.slice(0, 2).concat([
{
test: /^((?!svgs).)*\.(eot|ttf|woff|woff2|svg|png)$/,
loader: require.resolve("file-loader"),
},
]),
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "./dist"),
},
plugins: baseConfig.plugins.concat([
new CopyWebpackPlugin([
// to: is relative to dist/
{ from: "src/assets", to: "assets" },
{ from: "src/index.html", to: "." },
])
]),
});
features: [
"./src/index.scss",
"./src/features.tsx",
],
index: [
"./src/index.scss",
"./src/index.tsx",
],
},
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "./dist"),
},
plugins: baseConfig.plugins.concat([
new CopyWebpackPlugin([
// to: is relative to dist/
{ from: "src/index.html", to: "." },
{ from: "src/features.html", to: "." },
])
]),
});
const path = require("path");
module.exports = Object.assign({}, baseConfig, {
entry: {
"docs-app": [
"./src/index.tsx",
"./src/index.scss"
],
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "./dist"),
},
plugins: baseConfig.plugins.concat([
new CopyWebpackPlugin([
// to: is relative to dist/
{ from: "src/index.html", to: "." },
{ from: "src/assets/favicon.png", to: "assets" },
])
]),
});