How to use @angular-cli/base-href-webpack - 1 common examples

To help you get started, we’ve selected a few @angular-cli/base-href-webpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Electron-Microscope / electron-microscope / webpack-build-common.js View on Github external
{ test: /\.html$/, loader: 'raw-loader' },
                { test: /\.(otf|woff|ttf|svg)$/, loader: 'url?limit=10000' },
                { test: /\.woff2$/, loader: 'url?limit=10000&mimetype=font/woff2' },
                { test: /\.eot$/, loader: 'file' }
        plugins: [
            new CopyWebpackPlugin([{
                context: path.resolve(appRoot),
                from: "entry.js"
            new HtmlWebpackPlugin({
                template: path.resolve(appRoot, appConfig.index),
                chunksSortMode: 'dependency'
            new base_href_webpack_1.BaseHrefWebpackPlugin({
                baseHref: baseHref
            new webpack.NormalModuleReplacementPlugin(
            // This plugin is responsible for swapping the environment files.
            // Since it takes a RegExp as first parameter, we need to escape the path.
            // See
            new RegExp(path.resolve(appRoot, appConfig.environments['source'])
                .replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')), path.resolve(appRoot, appConfig.environments[environment])),
            new webpack.optimize.CommonsChunkPlugin({
                // Optimizing ensures loading order in index.html
                name: ['styles', 'scripts', 'main'].reverse()
            new webpack.optimize.CommonsChunkPlugin({
                minChunks: Infinity,
                name: 'inline',
                filename: 'inline.js',


Base HREF Webpack plugin

Latest version published 6 years ago

Package Health Score

72 / 100
Full package analysis

Popular @angular-cli/base-href-webpack functions

Popular JavaScript code snippets

Find secure code to use in your application or website