This commit is contained in:
Gianluca Guarini 2019-04-20 00:59:09 +02:00
parent 46113df053
commit 6f091b89d4
9 changed files with 7420 additions and 5 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules/*
node_modules
/test/dist

View File

@ -1,3 +1,3 @@
module.exports = function(bundler) {
bundler.addAssetType('tag', require.resolve('./RiotAsset'))
bundler.addAssetType('riot', require.resolve('./RiotAsset'))
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@riotjs/parcel-plugin-riot",
"version": "4.0.0",
"version": "4.0.0-alpha.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -4,8 +4,9 @@
"description": "A parcel plugin for riot.js",
"main": "index.js",
"scripts": {
"prepare": "npm i --no-save @riotjs/compiler",
"test": "npx eslint **/*.js"
"prepare": "npm i --no-save @riotjs/compiler parcel-bundler",
"test": "npx eslint *.js && npm run test-bundle",
"test-bundle": "cd test && npm i"
},
"license": "MIT",
"repository": {

13
test/index.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Parcel Plugin Riot Example</title>
</head>
<body>
<div id="root"></div>
<script src="./main.js"></script>
</body>
</html>

5
test/main.js Normal file
View File

@ -0,0 +1,5 @@
import MyComponent from './my-component.riot'
console.log(MyComponent)
export default MyComponent

9
test/my-component.riot Normal file
View File

@ -0,0 +1,9 @@
<my-component>
<p>{message}</p>
<script>
export default {
message: 'hello world'
}
</script>
</my-component>

7371
test/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

15
test/package.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "riot-parcel-test",
"main": "index.html",
"private": true,
"scripts": {
"postinstall": "parcel build index.html --no-cache"
},
"dependencies": {
"parcel-bundler": "^1.11.0"
},
"devDependencies": {
"@riotjs/compiler": "^4.0.0",
"@riotjs/parcel-plugin-riot": "file:../"
}
}