Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
add webpack to vue example
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalom committed Mar 23, 2020
1 parent 405da93 commit 5bbc2e6
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 26 deletions.
8 changes: 8 additions & 0 deletions example/vue/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;<html>
<head>
<title>breaky</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion example/vue/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vue from 'vue'
import '../.vue/assets/css/tailwind-built.css'
import '../assets/css/tailwind.css'
import resolveConfig from 'tailwindcss/resolveConfig'
import Breaky from '../../lib/plugin-vue'
import twd from '../tailwind.config'
Expand Down
3 changes: 3 additions & 0 deletions example/vue/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [require('tailwindcss'), require('autoprefixer')],
}
48 changes: 48 additions & 0 deletions example/vue/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')

module.exports = {
entry: './main.js',
resolve: {
extensions: ['.js', '.json', '.vue'],
modules: [
'node_modules',
'/Users/tom/Projects/nuxt-breaky/node_modules/nuxt-edge/bin/node_modules',
'/Users/tom/Projects/nuxt-breaky/node_modules/nuxt-edge/node_modules',
'/Users/tom/Projects/nuxt-breaky/node_modules',
'/Users/tom/Projects/node_modules',
'/Users/tom/node_modules',
'/Users/node_modules',
'/node_modules',
],
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader' },
{ test: /\.vue$/, use: 'vue-loader' },
{
test: /\.(sa|sc|c){1}ss$/i,
use: [
'style-loader',
'vue-style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
config: {
path: 'example/vue',
},
},
},
'sass-loader',
],
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: 'example/vue/index.html',
}),
new VueLoaderPlugin(),
],
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"dev": "yarn dev:nuxt",
"dev:nuxt": "nuxt example",
"dev:vue": "tailwindcss build example/assets/css/tailwind.css -o example/.vue/assets/css/tailwind-built.css -c example/tailwind.config.js && vue-cli-service serve example/vue/main.js",
"dev:vue": "webpack-dev-server --mode development --config example/vue/webpack.config.js --port 3000 example/vue/main.js",
"lint": "eslint --ext .js,.vue example lib test",
"release": "yarn test && yarn update:gh-pages && standard-version && git push --follow-tags && npm publish",
"release:patch": "yarn test && yarn update:gh-pages && standard-version --release-as patch && git push --follow-tags && npm publish",
Expand Down Expand Up @@ -54,7 +54,9 @@
"jest": "latest",
"nuxt-edge": "latest",
"prettier": "^1.19.1",
"standard-version": "latest"
"standard-version": "latest",
"style-loader": "^1.1.3",
"webpack-cli": "^3.3.11"
},
"resolutions": {
"minimist": "^1.2.5"
Expand Down
Loading

0 comments on commit 5bbc2e6

Please sign in to comment.