Commit 3572ca7b authored by hewenhao's avatar hewenhao

feat: ts-import-plugin

parent 24bcbfa7
......@@ -3,7 +3,6 @@ import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/style/normalize.css";
import "vant/lib/index.css";
import "amfe-flexible";
createApp(App)
.use(store)
......
/* eslint-disable @typescript-eslint/no-var-requires */
// const tsImportPluginFactory = require('ts-import-plugin')
const tsImportPluginFactory = require("ts-import-plugin");
module.exports = {
devServer: {
hot: true,
......@@ -24,6 +24,25 @@ module.exports = {
}
}
},
chainWebpack: config => {
config.module
.rule("ts")
.use("ts-loader")
.tap(options => {
return Object.assign(options || {}, {
transpileOnly: false,
getCustomTransformers: () => ({
before: [
tsImportPluginFactory({
libraryDirectory: "es",
libraryName: "vant",
style: true
})
]
})
});
});
},
css: {
loaderOptions: {
postcss: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment