mirror of
https://github.com/wickedest/Mergely.git
synced 2026-02-22 10:57:55 +08:00
BREAKING CHANGE: Mergely is no longer a jQuery plugin. BREAKING CHANGE: Removed `options.autoresize` BREAKING CHANGE: Removed `options.editor_width` BREAKING CHANGE: Removed `options.editor_height` BREAKING CHANGE: Removed `options.fadein` BREAKING CHANGE: Removed `options.fgcolor` BREAKING CHANGE: Removed `options.resize` BREAKING CHANGE: Removed `options.width` BREAKING CHANGE: Removed `options.height` BREAKING CHANGE: Removed `options.loaded` callback BREAKING CHANGE: Removed `options.resized` callback BREAKING CHANGE: Removed styles `.mergely-resizer`, `.mergely-full-screen-0`, and `.mergely-full-screen-8` BREAKING CHANGE: Changed default for `options.change_timeout` changed from `150` to `50`. BREAKING CHANGE: No longer automatically scrolls to first change. feat: CodeMirror is now an explicit dependency. feat: No longer necessary to separately require codemirror/addon/search/searchcursor feat: No longer necessary to separately require codemirror/addon/selection/mark-selection feat: `mergely.js` is now unminimized, and added new minimized version `mergely.min.js` feat: Gutter click now scrolls to any line feat: Mergely now emits `resize` event on resize feat: The UI is now non-blocking as diff now runs in background feat: Added support to provide `options.lhs` and `options.rhs` as strings feat: #16 added titles to editor.mergely.com fix: #165 block of changes at end of file are now distinguishable fix: #140 fixed performance issue with large files fix: Fixed issue where canvas markup was not rendered when `viewport` enabled fix: Fixed timing issue where swap sides may not work as expected. fix: Fixed issue where unmarkup did not emit an updated event. fix: Fixed documentation issue where `merge` incorrectly stated: from the specified `side` to the opposite side. fix: Fixed performance issue scrolling fix: Fixed issue where initial render scrolled to first change, showing it at the bottom (as opposed to middle as expected) fix: Fixed issue where line-diffs failed to diff non-alphanumeric characters
89 lines
1.4 KiB
JavaScript
89 lines
1.4 KiB
JavaScript
const path = require('path');
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
const dev = {
|
|
mode: 'production',
|
|
|
|
entry: {
|
|
mergely: './src/mergely.js',
|
|
},
|
|
|
|
devtool: 'eval-cheap-source-map',
|
|
|
|
module: {
|
|
rules: [{
|
|
test: /worker/,
|
|
loader: 'worker-loader',
|
|
options: { inline: 'no-fallback' }
|
|
}, {
|
|
include: [
|
|
path.resolve(__dirname, 'src'),
|
|
path.resolve(__dirname, 'examples')
|
|
],
|
|
test: /\.js$/
|
|
}, {
|
|
test: /\.css$/,
|
|
use: [{
|
|
loader: 'style-loader'
|
|
}, {
|
|
loader: 'css-loader'
|
|
}]
|
|
}]
|
|
},
|
|
|
|
output: {
|
|
path: path.join(__dirname, 'lib'),
|
|
filename: './[name].js',
|
|
library: 'mergely',
|
|
libraryTarget: 'umd',
|
|
umdNamedDefine: true,
|
|
libraryTarget: 'umd'
|
|
},
|
|
|
|
|
|
// module: {
|
|
// rules: [{
|
|
// test: /worker/,
|
|
// loader: 'worker-loader',
|
|
// options: { inline: 'no-fallback' }
|
|
// }, {
|
|
// loader: 'css-loader'
|
|
// }]
|
|
// },
|
|
|
|
resolve: {
|
|
extensions: ['.js']
|
|
},
|
|
// externals: [
|
|
// function external({ _, request }, cb) {
|
|
// if (request.indexOf('codemirror') >= 0) {
|
|
// // exclude, but expect global `CodeMirror`
|
|
// return cb(null, 'CodeMirror');
|
|
// }
|
|
// return cb();
|
|
// }
|
|
// ]
|
|
};
|
|
|
|
const prod = {
|
|
...dev,
|
|
mode: 'production',
|
|
output: {
|
|
...dev.output,
|
|
filename: './[name].min.js',
|
|
},
|
|
plugins: [
|
|
new CopyWebpackPlugin({
|
|
patterns: [{
|
|
from: 'src/mergely.css',
|
|
to: 'mergely.css',
|
|
toType: 'file'
|
|
}]
|
|
})
|
|
]
|
|
};
|
|
|
|
module.exports = (mode) => {
|
|
return [ dev, prod ];
|
|
}
|