mirror of
https://github.com/marktext/marktext.git
synced 2025-05-06 12:51:26 +08:00

* Experimental spellchecker for testing purpose * Fix 'apache' license validation * Use local electron-spellchecker for development * Add settings and bug fixes * Fix Hunspell switchLanguage bug and improvements * Fix attach to editor when enabling spell check again * Add Hunspell license * Copy default Huspell dictionary on first start * Fix full language name * Some code improvements * Allow to add words to user dict and bug fixes * Allow to change Muya's spellcheck container attribute * feat: Don't underline misspelled words * Allow to set Hunspell on macOS * Fix spellchecker changed value * Refactor switchLanguage, init and enableSpellchecker * Refactor and some fixes * Code improvements * electron-spellchecker cleanup and optimization * Disable automatic language detection for Hunspell * Fix init on macOS and update JSDoc * Fix macOS issues and some improvements * Load single settings value only * Fix rebase * Remove debug code * Move electron-spellchecker to scoped npm repo * Fix dictionary of ignored words on macOS * Move replaceWordInline to core API * Remove comment block * Fix upstream lint error
67 lines
1.5 KiB
JavaScript
67 lines
1.5 KiB
JavaScript
'use strict'
|
|
|
|
const merge = require('webpack-merge')
|
|
const webpack = require('webpack')
|
|
|
|
const baseConfig = require('../../.electron-vue/webpack.renderer.config')
|
|
|
|
// Set BABEL_ENV to use proper preset config
|
|
process.env.BABEL_ENV = 'test'
|
|
|
|
let webpackConfig = merge(baseConfig, {
|
|
devtool: '#inline-source-map',
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': '"testing"'
|
|
})
|
|
]
|
|
})
|
|
|
|
// don't treat dependencies as externals
|
|
delete webpackConfig.entry
|
|
delete webpackConfig.externals
|
|
delete webpackConfig.output.libraryTarget
|
|
|
|
// BUG: TypeError: Cannot read property 'loaders' of undefined
|
|
// // apply vue option to apply isparta-loader on js
|
|
// webpackConfig.module.rules
|
|
// .find(rule => rule.use.loader === 'vue-loader').use.options.loaders.js = 'babel-loader'
|
|
|
|
module.exports = config => {
|
|
config.set({
|
|
browsers: ['CustomElectron'],
|
|
customLaunchers: {
|
|
CustomElectron: {
|
|
base: 'Electron',
|
|
browserWindowOptions: {
|
|
webPreferences: {
|
|
nodeIntegration: true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
mode: 'development',
|
|
client: {
|
|
useIframe: false
|
|
},
|
|
coverageReporter: {
|
|
dir: './coverage',
|
|
reporters: [
|
|
{ type: 'lcov', subdir: '.' },
|
|
{ type: 'text-summary' }
|
|
]
|
|
},
|
|
frameworks: ['mocha', 'chai'],
|
|
files: ['./index.js'],
|
|
preprocessors: {
|
|
'./index.js': ['webpack', 'sourcemap']
|
|
},
|
|
reporters: ['spec', 'coverage'],
|
|
singleRun: true,
|
|
webpack: webpackConfig,
|
|
webpackMiddleware: {
|
|
noInfo: true
|
|
}
|
|
})
|
|
}
|