Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Extract css to fix SSR. Closes #67 #76

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ EU Cookie Law Plugin for Vue.js

<script>
import CookieLaw from 'vue-cookie-law'
import 'vue-cookie-law/dist/main.css'
export default {
components: { CookieLaw }
}
Expand Down
11 changes: 5 additions & 6 deletions build/webpack.release.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
const path = require('path');
const webpack = require('webpack');
const npmCfg = require('../package.json');
const projectRoot = path.resolve(__dirname, '../');
var vueLoaderConfig = require('./vue-loader.conf');
const vueLoaderConfig = require('./vue-loader.conf');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
var utils = require('./utils');
var config = require('../config')
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

function resolve (dir) {
return path.join(__dirname, '..', dir)
Expand Down Expand Up @@ -57,13 +55,14 @@ module.exports = {
},
{
test: /\.scss$/,
use: [require.resolve('vue-style-loader'), require.resolve('css-loader'), require.resolve('sass-loader')],
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
}
]
},

plugins: [
new webpack.BannerPlugin(banner),
new VueLoaderPlugin()
new VueLoaderPlugin(),
new MiniCssExtractPlugin()
]
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"prepublish": "npm run purge && npm run lint && npm run build"
},
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"@babel/core": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@nextindex/next-scss": "^1.2.0",
"autoprefixer": "^9.7.4",
"babel-eslint": "^10.1.0",
Expand Down Expand Up @@ -72,6 +72,7 @@
"jest": "^24.9.0",
"lodash": "^4.17.4",
"lolex": "^6.0.0",
"mini-css-extract-plugin": "^1.3.9",
"node-sass": "^4.9.0",
"opn": "^6.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
Expand All @@ -83,7 +84,7 @@
"url-loader": "^3.0.0",
"vue": "^2.5.17",
"vue-jest": "^4.0.0-0",
"vue-loader": "^15.9.0",
"vue-loader": "^15.9.6",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.5.17",
"vue-test-utils": "^1.0.0-beta.6",
Expand Down
Loading