Skip to content

Commit

Permalink
Update webpack configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Sep 29, 2017
1 parent 967187d commit 7de22c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/main.js → src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
grapesjs.plugins.add('gjs-preset-newsletter', (editor, opts) => {
export default grapesjs.plugins.add('gjs-preset-newsletter', (editor, opts) => {
let c = opts || {};
let config = editor.getConfig();
let pfx = config.stylePrefix;
Expand Down Expand Up @@ -234,12 +234,12 @@ grapesjs.plugins.add('gjs-preset-newsletter', (editor, opts) => {
openSmBtn && openSmBtn.set('active', 1);
}
});

editor.on('run:open-assets', () => {
const modal = editor.Modal;
modal.setTitle(defaults.assetsModalTitle);
})


// Do stuff on load
editor.on('load', function() {
Expand Down
22 changes: 7 additions & 15 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,19 @@ if(env !== 'dev'){
}

module.exports = {
entry: './src/main',
entry: './src',
output: {
filename: './dist/' + name + '.min.js',
library: name,
libraryTarget: 'umd',
},
module: {
preLoaders: [
{ test: /\.json$/, loader: 'json'},
],
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
include: /src/,
query: {
presets: ['es2015']
}
},
],
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
include: /src/,
exclude: /node_modules/
}],
},
plugins: plugins
};

0 comments on commit 7de22c0

Please sign in to comment.