-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-config.js
52 lines (47 loc) · 1.28 KB
/
webpack-config.js
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
51
52
// Require path.
const path = require( 'path' );
const wpPot = require('wp-pot');
// Configuration object.
const config = {
context: __dirname,
// Create the entry points.
// One for frontend and one for the admin area.
entry: {
// frontend and admin will replace the [name] portion of the output config below.
frontend: './src/front/front-index.js',
admin: './src/admin/admin-index.js'
},
// Create the output files.
// One for each of our entry points.
output: {
// [name] allows for the entry object keys to be used as file names.
filename: 'js/[name].js',
// Specify the path to the JS files.
path: path.resolve( __dirname, 'assets' )
},
// Setup a loader to transpile down the latest and great JavaScript so older browsers
// can understand it.
module: {
rules: [
{
// Look for any .js files.
test: /\.js$/,
// Exclude the node_modules folder.
exclude: /node_modules/,
// Use babel loader to transpile the JS files.
loader: 'babel-loader'
}
]
}
};
//// POT file.
wpPot( {
package: 'Features for WooCommerce',
domain: 'ffw',
destFile: 'i18n/languages/ffw.pot',
relativeTo: './',
src: [ './**/*.php' ],
bugReport: 'https://github.com/acrosswp/features-for-woocommerce/issues'
} );
// Export the config object.
module.exports = config;