I need help using webpack to compile my js and css.
Here is my webpack config:
const MiniCssExtractPlugin = require(‘mini-css-extract-plugin’);
const path = require(‘path’);
const MiniCssExtractPlugin = require(‘mini-css-extract-plugin’);
const path = require(‘path’);
module.exports = {
entry: {
app: './src/js/app.js',
},
output: {
path: path.resolve(__dirname, 'wp-content/themes'),
filename: 'js/app.js',
publicPath: '/'
},
module: {
rules: [
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{
test: /.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: 'ssa/css/[name].css',
}),
],
};
å
I have a app.js file in /src/js/app.js that I am trying to compile and output at /wp-content/themes/ssa/js/app.js.
I also have a app.scss file in /src/scss/app.scss that I am trying to compile and output at /wp-content/themes/ssa/css/app.css.
When running webpack, it says that webpack compiled, however I dont have any files at my output location.
Can anyone please help?