CodeCoupler Webpack Howto's
Change devServer Port
Ton contrast the default port "8080" of the devServer change this in the file webpack.config.js
in the root folder:
webpack.config.js
| module.exports = {
devServer: {
port: 8081
}
};
|
Exclude node_modules
webpack.cc-config.js
| module.exports = {
loaders: {
//Exclude all css files from node modules directory
css: {
exclude: /node_modules/,
},
},
};
|
Change Destination Output
webpack.config.js
| const path = require("path");
module.exports = {
output: { path: path.join(process.cwd(), "another-dist") },
devServer: {
contentBase: path.join(process.cwd(), "another-dist")
}
};
|
GetFilter only Bootstrap Tags from CodeCoupler Externals Configuration and all other Tags from
Compiling Result:
| <%=
htmlWebpackPlugin.tags.headTags.filter((tag) =>
(tag.attributes.src && tag.attributes.src.startsWith("vendor/bootstrap")) ||
(tag.attributes.href && tag.attributes.href.startsWith("vendor/bootstrap")) ||
(tag.attributes.src && !tag.attributes.src.startsWith("vendor/")) ||
(tag.attributes.href && !tag.attributes.href.startsWith("vendor/"))
).join('')
%>
|