Closed Dragons0458 closed 7 years ago
inside the webpack.common.js add the follow plugin
const SRC_DIR = join(process.cwd(), 'src');
new CopyWebpackPlugin([{ from: join(SRC_DIR, 'assets'), to: 'assets' }])
Hello man! Works perfectly, thank you very much, this is the final file in case someone else needs it:
const {root} = require('./helpers');
const CopyWebpackPlugin = require("copy-webpack-plugin");
/**
* This is a common webpack config which is the base for all builds
*/
module.exports = {
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.js']
},
output: {
path: root('dist')
},
module: {
rules: [
{test: /\.ts$/, loader: '@ngtools/webpack'},
{test: /\.css$/, loader: 'raw-loader'},
{test: /\.html$/, loader: 'raw-loader'}
]
},
plugins: [new CopyWebpackPlugin([{from: root('src/assets'), to: 'assets'}])]
};
Hi! How can I export the assets folder to the dist folder? Thank you!