forked from GrapesJS/grapesjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
60 lines (58 loc) · 1.74 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
//webpack --display-reasons
var webpack = require('webpack');
var pkg = require('./package.json');
var env = process.env.WEBPACK_ENV;
var name = 'grapesjs';
var plugins = [];
if(env !== 'dev'){
plugins = [
new webpack.optimize.UglifyJsPlugin({minimize: true}),
new webpack.BannerPlugin(pkg.name + ' - ' + pkg.version)
]
}
plugins.push(new webpack.ProvidePlugin({$: 'jquery'}));
module.exports = {
entry: './src/main',
output: {
filename: './dist/' + name + '.min.js',
library: name,
libraryTarget: 'umd',
},
plugins: plugins,
resolve: {
modulesDirectories: ['src', 'node_modules'],
alias: {
jquery: 'jquery/dist/jquery',
underscore: 'underscore/underscore',
backbone: 'backbone/backbone',
backboneUndo: 'backbone-undo/Backbone.Undo',
keymaster: 'keymaster/keymaster',
text: 'requirejs-text/text',
Spectrum: 'spectrum-colorpicker/spectrum',
codemirror: 'codemirror',
formatting: 'codemirror-formatting/formatting',
PluginManager: 'plugin_manager',
Abstract: 'domain_abstract',
Editor: 'editor',
AssetManager: 'asset_manager',
BlockManager: 'block_manager',
TraitManager: 'trait_manager',
StyleManager: 'style_manager',
DeviceManager: 'device_manager',
StorageManager: 'storage_manager',
PluginManager: 'plugin_manager',
Navigator: 'navigator',
DomComponents: 'dom_components',
RichTextEditor: 'rich_text_editor',
SelectorManager: 'selector_manager',
ModalDialog: 'modal_dialog',
CodeManager: 'code_manager',
CssComposer: 'css_composer',
Commands: 'commands',
Canvas: 'canvas',
Panels: 'panels',
Parser: 'parser',
Utils: 'utils',
}
},
}