piral-vue 0.15.9-beta.5420 → 0.15.9-beta.5435
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/extend-webpack.js +19 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -89,6 +89,65 @@ The `vue` package should be shared with the pilets via the *package.json*:
|
|
|
89
89
|
|
|
90
90
|
:::
|
|
91
91
|
|
|
92
|
+
## Development Setup
|
|
93
|
+
|
|
94
|
+
For your bundler additional packages may be necessary. For instance, for Webpack the following setup is required:
|
|
95
|
+
|
|
96
|
+
First, install the additional dev dependencies
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
npm i vue-loader@^15 @vue/compiler-sfc@^2 --save-dev
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
then add a *webpack.config.js* to use them
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
const { VueLoaderPlugin } = require('vue-loader');
|
|
106
|
+
|
|
107
|
+
module.exports = function (config) {
|
|
108
|
+
config.module.rules.push({
|
|
109
|
+
test: /\.vue$/,
|
|
110
|
+
use: 'vue-loader'
|
|
111
|
+
});
|
|
112
|
+
config.plugins.push(new VueLoaderPlugin());
|
|
113
|
+
return config;
|
|
114
|
+
};
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Now, *.vue* files are correctly picked up and handled.
|
|
118
|
+
|
|
119
|
+
Alternatively, the Webpack configuration can be rather simplistic. In many cases you can use the convenience `extend-webpack` module.
|
|
120
|
+
|
|
121
|
+
This is how your *webpack.config.js* can look like with the convenience module:
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
const extendWebpack = require('piral-vue/extend-webpack');
|
|
125
|
+
|
|
126
|
+
module.exports = extendWebpack({});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
For using `piral-vue/extend-webpack` you must have installed:
|
|
130
|
+
|
|
131
|
+
- `vue-loader` (at version 15)
|
|
132
|
+
- `@vue/compiler-sfc^2`
|
|
133
|
+
- `webpack`, e.g., via `piral-cli-webpack5`
|
|
134
|
+
|
|
135
|
+
You can do that via:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
npm i vue-loader@^15 @vue/compiler-sfc^2 piral-cli-webpack5 --save-dev
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The available options for `piral-vue/extend-webpack` are the same as for the options of the `vue-loader`, e.g.:
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
const extendWebpack = require('piral-vue/extend-webpack');
|
|
145
|
+
|
|
146
|
+
module.exports = extendWebpack({
|
|
147
|
+
customElement: /\.ce\.vue$/,
|
|
148
|
+
});
|
|
149
|
+
```
|
|
150
|
+
|
|
92
151
|
## License
|
|
93
152
|
|
|
94
153
|
Piral is released using the MIT license. For more information see the [license file](./LICENSE).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { VueLoaderPlugin } = require('vue-loader');
|
|
2
|
+
|
|
3
|
+
const vueLoader = require.resolve('vue-loader');
|
|
4
|
+
|
|
5
|
+
module.exports =
|
|
6
|
+
(options = {}) =>
|
|
7
|
+
(config) => {
|
|
8
|
+
config.plugins.push(new VueLoaderPlugin());
|
|
9
|
+
|
|
10
|
+
config.module.rules.unshift({
|
|
11
|
+
test: /\.vue$/,
|
|
12
|
+
use: {
|
|
13
|
+
loader: vueLoader,
|
|
14
|
+
options,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return config;
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-vue",
|
|
3
|
-
"version": "0.15.9-beta.
|
|
3
|
+
"version": "0.15.9-beta.5435",
|
|
4
4
|
"description": "Plugin for integrating Vue@2 components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
"./convert": {
|
|
29
29
|
"import": "./convert.js"
|
|
30
30
|
},
|
|
31
|
+
"./extend-webpack": {
|
|
32
|
+
"require": "./extend-webpack.js"
|
|
33
|
+
},
|
|
31
34
|
"./esm/*": {
|
|
32
35
|
"import": "./esm/*"
|
|
33
36
|
},
|
|
@@ -46,7 +49,8 @@
|
|
|
46
49
|
"lib",
|
|
47
50
|
"src",
|
|
48
51
|
"convert.d.ts",
|
|
49
|
-
"convert.js"
|
|
52
|
+
"convert.js",
|
|
53
|
+
"extend-webpack.js"
|
|
50
54
|
],
|
|
51
55
|
"repository": {
|
|
52
56
|
"type": "git",
|
|
@@ -65,11 +69,11 @@
|
|
|
65
69
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
66
70
|
},
|
|
67
71
|
"devDependencies": {
|
|
68
|
-
"piral-core": "0.15.9-beta.
|
|
72
|
+
"piral-core": "0.15.9-beta.5435",
|
|
69
73
|
"vue": "^2.6.10"
|
|
70
74
|
},
|
|
71
75
|
"peerDependencies": {
|
|
72
76
|
"vue": "^2.0.0"
|
|
73
77
|
},
|
|
74
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "9a36cc1b229556a4a0fcd7075cc51bdfd6190fe2"
|
|
75
79
|
}
|