Skip to content

Commit

Permalink
Fix #167
Browse files Browse the repository at this point in the history
  • Loading branch information
kawsarahmedr committed Sep 2, 2024
1 parent 249040f commit d29ca2e
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .assets/css/admin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "../../lib/Lib/assets/css/layout";
@import "../../lib/Lib/assets/css/card";
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions assets/css/admin.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '4a44ffb22ebd9b0a0ab6');
1 change: 1 addition & 0 deletions assets/css/admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions assets/src/css/admin.scss

This file was deleted.

Empty file removed assets/src/js/.gitkeep
Empty file.
55 changes: 45 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');

module.exports = [
{
...defaultConfig,
entry: {
...defaultConfig.entry(),
'css/admin': './assets/src/css/admin.scss',
'css/admin': './.assets/css/admin.scss',
},
output: {
...defaultConfig.output,
filename: '[name].js',
path: __dirname + '/assets/dist/',
path: __dirname + '/assets/',
},
plugins: [
...defaultConfig.plugins,
new RemoveEmptyScriptsPlugin({
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
remove: /\.(js)$/,
}),
],
},
module: {
rules: [
...defaultConfig.module.rules,
{
test: /\.svg$/,
issuer: /\.(j|t)sx?$/,
use: ['@svgr/webpack', 'url-loader'],
type: 'javascript/auto',
},
{
test: /\.svg$/,
issuer: /\.(sc|sa|c)ss$/,
type: 'asset/inline',
},
{
test: /\.(bmp|png|jpe?g|gif)$/i,
type: 'asset/resource',
generator: {
filename: 'images/[name].[hash:8][ext]',
},
},
],
},
plugins: [
...defaultConfig.plugins,
// Copy images to the build folder.
// new CopyWebpackPlugin({
// patterns: [
// {
// from: path.resolve(__dirname, '.assets/images'),
// to: path.resolve(__dirname, 'assets/images'),
// }
// ]
// }),

new RemoveEmptyScriptsPlugin({
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
remove: /\.(js)$/,
}),
],
},
];

0 comments on commit d29ca2e

Please sign in to comment.