Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Add CodeSandbox support #3

Open
wants to merge 9 commits into
base: master
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vue-next-webpack-preview

Minimal webpack setup for Vue 3 (alpha). This is for preview purposes only. There might be bugs and undocumented behavior differences from v2, which are expected.
Minimal webpack setup for Vue 3 (beta). This is for preview purposes only. There might be bugs and undocumented behavior differences from v2, which are expected.

Also note that if you are using VSCode, Vetur isn't updated to take advantage of Vue 3's typing yet so intellisense in Vue files may not be fully functional (especially in templates).
15 changes: 12 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<link rel="stylesheet" href="/dist/main.css">
<div id="app"></div>
<script src="/dist/main.js"></script>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>vue-next preview</title>
<link rel="stylesheet" href="/dist/main.css">
</head>
<body>
<div id="app"></div>
<script src="/dist/main.js"></script>
</body>
</html>
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"build": "webpack --env.prod"
},
"dependencies": {
"vue": "^3.0.0-alpha.1"
"vue": "^3.0.0-beta.3"
},
"devDependencies": {
"@vue/compiler-sfc": "^3.0.0-alpha.1",
"css-loader": "^3.4.0",
"file-loader": "^5.0.2",
"@vue/compiler-sfc": "^3.0.0-beta.3",
"css-loader": "^3.5.2",
"file-loader": "^6.0.0",
"mini-css-extract-plugin": "^0.9.0",
"url-loader": "^3.0.0",
"vue-loader": "^16.0.0-alpha.1",
"webpack": "^4.41.4",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.10.1"
"url-loader": "^4.1.0",
"vue-loader": "^16.0.0-alpha.3",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
}
}
3 changes: 3 additions & 0 deletions sandbox.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"template": "nuxt"
}
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createApp } from 'vue'
import App from './App.vue'

createApp().mount(App, '#app')
createApp(App).mount('#app')
9 changes: 7 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = (env = {}) => ({
mode: env.prod ? 'production' : 'development',
devtool: env.prod ? 'source-map' : 'cheap-module-eval-source-map',
entry: path.resolve(__dirname, './src/main.js'),
entry: [
env.prod ? false : require.resolve(`webpack-dev-server/client`),
path.resolve(__dirname, './src/main.js')
].filter(Boolean),
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/'
Expand Down Expand Up @@ -55,6 +58,8 @@ module.exports = (env = {}) => ({
hot: true,
stats: 'minimal',
contentBase: __dirname,
overlay: true
overlay: true,
injectClient: false,
disableHostCheck: true
}
})
Loading