Charles Lyding 6eca86b817 refactor(@angular-devkit/build-angular): replace raw-loader with Webpack 5 asset modules
With Webpack 5, the `raw-loader` is no longer needed and its functionality is provided via configuration options within the Webpack configuration via asset modules.  Asset modules (https://webpack.js.org/guides/asset-modules/) provide a built-in way to provide `raw-loader`, `url-loader`, and `file-loader` functionality without additional dependencies.
2021-07-07 15:51:19 -04:00

36 lines
889 B
JavaScript

const ngToolsWebpack = require('@ngtools/webpack');
const path = require('path');
const workspaceRoot = path.resolve(__dirname, './');
const projectRoot = path.resolve(__dirname, './');
module.exports = {
mode: 'development',
resolve: {
extensions: ['.ts', '.js'],
},
entry: {
main: path.resolve(projectRoot, './src/main.ts'),
polyfills: path.resolve(projectRoot, './src/polyfills.ts'),
},
output: {
path: path.resolve(workspaceRoot, './dist'),
filename: `[name].js`,
},
plugins: [
new ngToolsWebpack.AngularWebpackPlugin({
tsconfig: path.resolve(projectRoot, './src/tsconfig.app.json'),
}),
],
module: {
rules: [
{ test: /\.css$/, type: 'asset/source' },
{ test: /\.html$/, type: 'asset/source' },
{ test: /\.ts$/, loader: '@ngtools/webpack' },
],
},
devServer: {
historyApiFallback: true,
},
};