CodeCoupler Webpack Import Vue Single File Components
You can use .vue files in the src folder, which will be interpreted as vue single-file
components.
Vue is not included as a dependency by default! 2 Therefore, you must install vue in your
project first:
To exclude the Vue library from the build result, add the following to the externals array in your
CodeCoupler Webpack configuration:
Note 1: You can use <style module> to compile the stylesheet into CSS Modules and use the
classes with $style Documentation. 1
Note 2: The style tag must not be specified with the lang attribute to use modern CSS. It
will always be parsed like any other CSS file (see above). However, to work with the the Vetur
validator, you should use lang="postcss".
Note 3: Linked assets inside of the <template> must start with ./:
-
You can use
<style module>from version 3.4 ↩ -
Until version 4.2, Vue was included as a dependency by default. If you install
cc-webpack, you do not need to installvuein your project. Simply useimport Vue from "vue";and you can start writing Vue Applications. However, you must pay attention to exclude Vue from your bundle! ↩