Answer the question
In order to leave comments, you need to log in
How to create define for one vue document?
Hello,
I have a Vue component file structure like this
<template>...</template>
<style lang="scss" scoped></style>
<script></script>
#define SOMETHING 1;
$my-scss-var: SOMETHING;
let myJsVar = SOMETHING;
<div>SOMETHING</div>
Answer the question
In order to leave comments, you need to log in
Apparently, you just need to replace one line with another?
In webpack, such transformations are done using loaders, for example, string-replace-loader may suit you (I don’t use it myself, but according to the text of the task - why not).
But in general, this is strange, both IDE and linters will swear at SOMETHING that does not exist in this context, and in general it is some kind of magic, and the less magic, the better.
If you give a specific example, rather than an abstract SOMETHING, then it will be clearer what you want and probably a more obvious solution can be advised.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question