Skip to content

Commit 1dd0032

Browse files
committed
Cleanup to webpack for mods and misc
1 parent 5379fed commit 1dd0032

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

contributed/vue-starter/src/App.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
This is the template section where we define the HTML structure of our component.
44
In Vue, we use a single-file component (SFC) approach that combines template, logic, and styles.
55
-->
6+
<!--
7+
Please note that this document does not use the spectrum web components theme for Express.
8+
You may use "addOnUISdk.app.ui.theme" to get the current theme and style accordingly.
9+
-->
10+
611
<div class="container">
712
<!--
813
Vue directives start with ':' or 'v-' and provide special functionality:

contributed/vue-starter/src/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
88
<title>Get Started with Vue</title>
99
</head>
10-
<body>
11-
<!--
12-
Please note that this document does not use the spectrum web components theme for Express.
13-
You may use "addOnUISdk.app.ui.theme" to get the current theme and style accordingly.
14-
-->
15-
10+
<body>
1611
<!--
1712
This is the mounting point for our Vue application.
1813
The <div id="app"></div> element is where Vue will render everything.

contributed/vue-starter/webpack.config.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ export default (env, argv) => {
1616
output: {
1717
filename: "index.js",
1818
path: path.resolve(__dirname, "dist"),
19-
clean: true
19+
clean: true,
20+
module: true,
21+
library: {
22+
type: 'module'
23+
},
24+
environment: {
25+
module: true
26+
}
2027
},
2128
externalsType: "module",
2229
experiments: {
@@ -34,7 +41,11 @@ export default (env, argv) => {
3441
use: {
3542
loader: 'babel-loader',
3643
options: {
37-
presets: ['@babel/preset-env']
44+
presets: [
45+
['@babel/preset-env', {
46+
modules: false
47+
}]
48+
]
3849
}
3950
}
4051
},
@@ -48,7 +59,8 @@ export default (env, argv) => {
4859
new VueLoaderPlugin(),
4960
new HtmlWebpackPlugin({
5061
template: './src/index.html',
51-
inject: true
62+
inject: 'head',
63+
scriptLoading: 'module'
5264
}),
5365
new CopyWebpackPlugin({
5466
patterns: [
@@ -62,7 +74,7 @@ export default (env, argv) => {
6274
resolve: {
6375
extensions: ['.js', '.vue', '.json'],
6476
alias: {
65-
'vue': '@vue/runtime-dom'
77+
'vue': 'vue/dist/vue.esm-browser.js'
6678
}
6779
},
6880
devServer: {

0 commit comments

Comments
 (0)