Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. :export {
  2. cursor: #fff;
  3. }
  4.  
  5. <template>
  6. <div id="yes">
  7. </div>
  8. </template>
  9.  
  10. <script lang="ts">
  11. import Vue from 'vue';
  12. import colors from '@/scss/vars.scss';
  13.  
  14. export default Vue.extend({
  15. mounted() {
  16. console.log(colors.cursor);
  17. },
  18. });
  19. </script>
  20.  
  21. <style >
  22. </style>
  23.  
  24. const path = require('path');
  25. const HtmlWebpackPlugin = require('html-webpack-plugin');
  26. const CleanWebpackPlugin = require('clean-webpack-plugin');
  27. const webpack = require('webpack');
  28. const VueLoaderPlugin = require('vue-loader/lib/plugin');
  29. const env = process.env.NODE_ENV
  30.  
  31. module.exports = {
  32. entry: './app/index.ts',
  33. output: {
  34. filename: 'main.js',
  35. path: path.resolve(__dirname, 'staticfiles')
  36. },
  37. resolve: {
  38. extensions: [ '.ts', '.js', '.vue', '.scss', '.sass'],
  39. alias: {
  40. 'vue$': 'vue/dist/vue.esm.js',
  41. '@': path.resolve(__dirname, '/app/')
  42. }
  43. },
  44. plugins: [
  45. new HtmlWebpackPlugin(),
  46. new CleanWebpackPlugin(),
  47. new webpack.HotModuleReplacementPlugin(),
  48. new VueLoaderPlugin()
  49. ],
  50. module: {
  51. rules: [
  52. {
  53. enforce: 'pre',
  54. test: /.(js|vue|ts)$/,
  55. loader: 'eslint-loader',
  56. exclude: /node_modules/
  57. },
  58. {
  59. test: /.vue$/,
  60. loader: 'vue-loader',
  61. options: {
  62. loaders: {
  63. // Since sass-loader (weirdly) has SCSS as its default parse mode, we map
  64. // the "scss" and "sass" values for the lang attribute to the right configs here.
  65. // other preprocessors should work out of the box, no loader config like this necessary.
  66. 'scss': 'vue-style-loader!css-loader!sass-loader',
  67. 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax',
  68. }
  69. // other vue-loader options go here
  70. }
  71. },
  72. {
  73. test: /.css$/,
  74. use: [
  75. 'vue-style-loader',
  76. 'css-loader'
  77. ]
  78. },
  79. {
  80. test: /.tsx?$/,
  81. loader: 'ts-loader',
  82. exclude: /node_modules/,
  83. options: {
  84. appendTsSuffixTo: [/.vue$/],
  85. }
  86. },
  87. {
  88. test: /.(png|jpg|gif|svg)$/,
  89. loader: 'file-loader',
  90. options: {
  91. name: '[name].[ext]?[hash]'
  92. }
  93. },
  94. {
  95. test: /.s(a|c)ss$/,
  96. use: [ {
  97. loader: "style-loader",
  98. options: {
  99. sourceMap: env === 'development',
  100. }
  101. }, {
  102. loader: "css-loader",
  103. options: {
  104. sourceMap: env === 'development',
  105. }
  106. }, {
  107. loader: "sass-loader",
  108. options: {
  109. sourceMap: env === 'development',
  110. }
  111. },
  112. 'vue-style-loader'],
  113. }]
  114. }
  115. };
  116.  
  117. ERROR in /home/Documents/application/app/app.vue.ts
  118. [tsl] ERROR in /home/Documents/application/app/app.vue.ts(10,28)
  119. TS2307: Cannot find module '@/scss/vars.scss'.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement