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