GithubHelp home page GithubHelp logo

Comments (9)

ccqgithub avatar ccqgithub commented on July 20, 2024

可以啊,你怎么配置的

from fis3-parser-vue-component.

k-jay-wang avatar k-jay-wang commented on July 20, 2024

`fis.match('modules/**.vue', {
isMod: true,
rExt: 'js',
useSameNameRequire: true,
parser: fis.plugin('vue-component')
});

fis.match('(modules/**.css)', {
useSameNameRequire: true,
release: 'static/css/$1'
});

fis.match('modules/(**).js', {
isMod: true,
useSameNameRequire: true,
moduleId: '$1',
rExt: 'js',
});

fis.match('node_modules/().js', {
isMod: true,
rExt: 'js'
});
fis.match('modules/(
.js)', {
packTo: 'static/scripts/modules.js'
})

fis.match('::package', {
postpackager: fis.plugin('loader')
});`

fis-conf里面是这么写的,但是打包的时候没有把文件打进去。。。

from fis3-parser-vue-component.

ccqgithub avatar ccqgithub commented on July 20, 2024
fis.match('modules/**.vue:css', {
  packTo: 'component-all.css'
});

试试这样呢

from fis3-parser-vue-component.

k-jay-wang avatar k-jay-wang commented on July 20, 2024

fis.match('modules/**.vue:js', {
packTo: 'static/scripts/modules.js'
})

使用了这种方式,也还是不行。。

from fis3-parser-vue-component.

k-jay-wang avatar k-jay-wang commented on July 20, 2024

测试了一下,CSS是可以的,但是JS文件不行。。。是不是因为JS文件是被rExt转出来的所以不行。。

from fis3-parser-vue-component.

ccqgithub avatar ccqgithub commented on July 20, 2024

vue:js 这个js是对应你组件里面script标签的lang的

from fis3-parser-vue-component.

k-jay-wang avatar k-jay-wang commented on July 20, 2024

对的,我的意思就是是不是因为在走到packTo这一步的时候其实文件夹里的.js还没有生成,所以无法被packTo打包进去,或者是不是 .vue:js这样的写法不被packTo这个方法识别所以无法打包进去。。。

fis.match('(modules/**.css)', {
packTo: 'static/css/modules-all.css'
});

fis.match('modules/**.js', {
packTo: 'modules/modules-all.js'
});

很奇怪这一点,就是css和js都是.vue文件拆分来的,css文件能被打包合并,js文件就不行。。。

from fis3-parser-vue-component.

k-jay-wang avatar k-jay-wang commented on July 20, 2024

问题解决啦~

在packTo方法里面不要用.vue:js,直接使用.vue,就会把parser后的js文件合并进来。
fis.match('::package', { packager: fis.plugin('map', { 'static/scripts/modules-all.js': [ 'modules/**.js', 'modules/**.vue' ] }) });

感谢花费时间帮我解答问题~

from fis3-parser-vue-component.

ccqgithub avatar ccqgithub commented on July 20, 2024

@k-jay-wang 原因是这样的,vue组件真正输出内容的其实是里面的js,而样式是会创建新文件,所以配置方式略有不同~~

from fis3-parser-vue-component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.