mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-28 23:59:25 +08:00
31 lines
731 B
JavaScript
31 lines
731 B
JavaScript
const path = require('path')
|
|
const globby = require('globby')
|
|
|
|
module.exports = function (api) {
|
|
api.chainWebpack(config => {
|
|
config.resolve.extensions
|
|
.add('.ts')
|
|
.add('.jsx')
|
|
|
|
config.module
|
|
.rule('typescript')
|
|
.test(/\.tsx?$/)
|
|
.use()
|
|
.loader('ts-loader')
|
|
.options({ appendTsSuffixTo: [/\.vue$/] })
|
|
|
|
config.module
|
|
.rule('jsx')
|
|
.test(/\.jsx?$/)
|
|
.use()
|
|
.loader('babel-loader')
|
|
|
|
globby.sync('../packages/*', { onlyDirectories: true })
|
|
.map(name => name.replace('../packages/', ''))
|
|
.forEach(name => {
|
|
config.resolve.alias
|
|
.set(`@tiptap/${name}`, path.resolve(`../packages/${name}`))
|
|
})
|
|
})
|
|
}
|