Skip to content

Commit

Permalink
variable.scss globale taşıyayım derken patlamış önceki committe :/ dü…
Browse files Browse the repository at this point in the history
…zelttildi
  • Loading branch information
ademilter committed Apr 10, 2018
1 parent a8b4eca commit 91a2223
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
19 changes: 12 additions & 7 deletions build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
const pkg = require('../package.json')

exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
const assetsSubDirectory =
process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}

Expand All @@ -29,8 +30,10 @@ exports.cssLoaders = function (options) {
}

// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
function generateLoaders(loader, loaderOptions) {
const loaders = options.usePostCSS
? [cssLoader, postcssLoader]
: [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
Expand All @@ -57,8 +60,10 @@ exports.cssLoaders = function (options) {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
sass: generateLoaders('sass', {indentedSyntax: true}),
scss: generateLoaders('sass', {
data: '@import "~@/stylesheet/config/variables";'
}),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
Expand Down
8 changes: 0 additions & 8 deletions build/vue-loader.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'
const utils = require('./utils')
const fs = require('fs')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
Expand All @@ -12,13 +11,6 @@ module.exports = {
sourceMap: sourceMapEnabled,
extract: isProduction
}),
css: {
loaderOptions: {
sass: {
data: fs.readFileSync('src/stylesheet/config/variables.scss', 'utf-8')
}
}
},
cssSourceMap: sourceMapEnabled,
cacheBusting: config.dev.cacheBusting,
transformToRequire: {
Expand Down
1 change: 1 addition & 0 deletions src/view/pages/Home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<style lang="scss">
.Home {
padding: 50px;
color: $color-primary;
}
</style>

0 comments on commit 91a2223

Please sign in to comment.