Repository navigation
Expand file tree
/
Copy pathwebpack.config.admin.js
More file actions
50 lines (47 loc) · 2 KB
/
Copy pathwebpack.config.admin.js
File metadata and controls
50 lines (47 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const DependencyExtractionWebpackPlugin = require('@wordpress/dependency-extraction-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require('path');
module.exports = {
...defaultConfig,
cache: {
type: "filesystem",
cacheDirectory: path.resolve(__dirname, ".cache/webpack-admin"),
buildDependencies: {
config: [__filename],
},
},
resolve: {
alias: {
...defaultConfig.resolve.alias,
'@Controls': path.resolve(__dirname, 'blocks-config/fb-controls/'),
'@Components': path.resolve(__dirname, 'src/components/'),
'@Config': path.resolve(__dirname, 'src/config/'),
'@Utils': path.resolve(__dirname, 'src/utils/'),
'@Blocks': path.resolve(__dirname, 'src/blocks/'),
'@Store': path.resolve(__dirname, 'src/store/'),
'@Constants': path.resolve(__dirname, 'src/fbConstants/'),
'@Attributes': path.resolve(__dirname, 'blocks-config/blocks-attributes/'),
},
},
entry: {
dashboard: path.resolve(process.cwd(), 'admin', 'dashboard', 'index.js'),
// dynamicContent: path.resolve(process.cwd(), 'admin', 'dynamic-content', 'index.js'),
sidebar: path.resolve(process.cwd(), 'admin', 'sidebar', 'index.js'),
tlibrary:path.resolve(process.cwd(), 'admin', 'template-library', 'index.js'),
tlsite:path.resolve(process.cwd(), 'admin', 'template-library-site', 'index.js'),
quickAccess:path.resolve(process.cwd(), 'admin', 'quick-sidebar', 'index.js'),
blockRecovery: path.resolve(process.cwd(), 'admin', 'block-recovery', 'index.js'),
copyPasteStyle: path.resolve(process.cwd(), 'admin', 'copy-paste', 'index.js'),
highlightColor: path.resolve(process.cwd(), 'admin', 'highlight-color', 'index.js'),
headerFooterInstall: path.resolve(process.cwd(), 'admin', 'header-footer', 'index.js'),
},
output: {
path: path.resolve(process.cwd(), 'assets', 'admin'),
filename: '[name].js',
},
plugins: [
new DependencyExtractionWebpackPlugin(),
new MiniCssExtractPlugin
],
};