-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
27 lines (26 loc) · 1.12 KB
/
webpack.config.js
File metadata and controls
27 lines (26 loc) · 1.12 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
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const path = require('path');
module.exports = {
...defaultConfig,
entry: {
'question-editor': path.resolve(process.cwd(), 'src', 'question-editor', 'index.js'),
'quiz-editor': path.resolve(process.cwd(), 'src', 'quiz-editor', 'index.js'),
'bank-editor': path.resolve(process.cwd(), 'src', 'bank-editor', 'index.js'),
'settings-panel': path.resolve(process.cwd(), 'src', 'settings-panel', 'index.js'),
'dashboard': path.resolve(process.cwd(), 'src', 'dashboard', 'index.js'),
'reports': path.resolve(process.cwd(), 'src', 'reports', 'index.js'),
'onboarding': path.resolve(process.cwd(), 'src', 'onboarding', 'index.js'),
'blocks/quiz/index': path.resolve(process.cwd(), 'blocks', 'quiz', 'index.js'),
'blocks/my-attempts/index': path.resolve(process.cwd(), 'blocks', 'my-attempts', 'index.js'),
},
output: {
path: path.resolve(process.cwd(), 'build'),
filename: (pathData) => {
// Output blocks to their own directories
if (pathData.chunk.name.startsWith('blocks/')) {
return '[name].js';
}
return '[name].js';
},
},
};