forked from ezsystems/ezplatform-admin-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
125 lines (124 loc) · 8.52 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: {
ezBtnAnchor: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-anchor.js',
ezBtnAnchorEdit: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-anchoredit.js',
ezBtnParagraph: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-paragraph.js',
ezBtnHeading: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-heading.js',
ezBtnMoveDown: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-movedown.js',
ezBtnMoveUp: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-moveup.js',
ezBtnBlockTextAlignCenter: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-blocktextaligncenter.js',
ezBtnBlockTextAlignJustify: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-blocktextalignjustify.js',
ezBtnBlockTextAlignLeft: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-blocktextalignleft.js',
ezBtnBlockTextAlignRight: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-blocktextalignright.js',
ezBtnRemoveBlock: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-removeblock.js',
ezBtnUnorderedList: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-unorderedlist.js',
ezBtnOrderedList: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-orderedlist.js',
ezBtnTable: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-table.js',
ezBtnTableCell: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-tablecell.js',
ezBtnTableRow: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-tablerow.js',
ezBtnTableColumn: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-tablecolumn.js',
ezBtnTableRemove: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-tableremove.js',
ezBtnBold: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-bold.js',
ezBtnItalic: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-italic.js',
ezBtnUnderline: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-underline.js',
ezBtnSubscript: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-subscript.js',
ezBtnSuperscript: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-superscript.js',
ezBtnQuote: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-quote.js',
ezBtnStrike: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-strike.js',
ezBtnLink: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-link.js',
ezBtnLinkEdit: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-linkedit.js',
ezBtnImage: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-image.js',
ezBtnImageUpdate: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-imageupdate.js',
ezBtnImageVariation: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-imagevariation.js',
ezBtnImageLink: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-imagelink.js',
ezBtnImageLinkEdit: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-imagelinkedit.js',
ezBtnEmbed: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embed.js',
ezBtnEmbedInline: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embedinline.js',
ezBtnEmbedUpdate: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embedupdate.js',
ezBtnEmbedAlingCenter: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embedaligncenter.js',
ezBtnEmbedAlingLeft: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embedalignleft.js',
ezBtnEmbedAlingRight: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-embedalignright.js',
ezBtnCustomTag: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-customtag.js',
ezBtnCustomTagEdit: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-customtag-edit.js',
ezBtnCustomTagUpdate: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-customtag-update.js',
ezBtnInlineCustomTag: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-inlinecustomtag.js',
ezBtnInlineCustomTagEdit: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-inlinecustomtag-edit.js',
ezBtnInlineCustomTagUpdate: './src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-inlinecustomtag-update.js',
ezToolbarAdd: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/ez-add.js',
ezPluginAddContent: './src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-add-content.js',
ezPluginMoveElement: './src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-move-element.js',
ezPluginCaret: './src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-caret.js',
ezPluginRemoveBlock: './src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-remove-block.js',
ezPluginEmbed: './src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-embed.js',
ezPluginFocusBlock: './src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-focus-block.js',
ezPluginCustomTag: './src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js',
ezParagraphConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-paragraph.js',
ezFormattedConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-formatted.js',
ezTextConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-text.js',
ezListConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-list.js',
ezTableConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-table.js',
ezLinkConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-link.js',
ezHeadingConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-heading.js',
ezEmbedConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-embed.js',
ezEmbedInlineConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-embed-inline.js',
ezEmbedImageConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-image.js',
ezEmbedImageLinkConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-image-link.js',
ezCustomTagConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-custom-tag.js',
ezInlineCustomTagConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-inline-custom-tag.js',
ezCustomStyleConfig: './src/bundle/Resources/public/js/alloyeditor/src/toolbars/config/ez-custom-style.js',
ezCoreTable: './src/bundle/Resources/public/js/alloyeditor/src/core/table.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'src/bundle/Resources/public/js/alloyeditor/dist'),
library: ['eZ', 'ezAlloyEditor', '[name]'],
libraryTarget: 'umd',
libraryExport: 'default',
},
devtool: 'source-map',
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
alloyeditor: {
root: 'AlloyEditor',
commonjs2: 'AlloyEditor',
commonjs: 'AlloyEditor',
amd: 'AlloyEditor',
},
},
plugins: [
new CleanWebpackPlugin(['src/bundle/Resources/public/js/alloyeditor/dist']),
new UglifyJSPlugin({
sourceMap: true,
uglifyOptions: {
ecma: 6,
},
}),
],
};