Browse Source

example

pull/1/head
Ivan Polyakov 2 years ago
parent
commit
273e507fa6
  1. 23
      README.md
  2. 2276
      example/package-lock.json
  3. 17
      example/package.json
  4. 0
      example/src/index.js
  5. 5
      example/src/index.sxml
  6. 27
      example/webpack.config.js

23
README.md

@ -11,6 +11,29 @@ sxml-loader @@ -11,6 +11,29 @@ sxml-loader
Scheme XML loader for webpack.
Usage
-----
**SXML**:
```scm
'(h1 "Hello")
```
**webpack.config.js**:
```js
module.exports = {
module: {
// ...
rules: [
{
test: /\.sxml$/,
use: ['html-loader', 'sxml-loader'],
},
],
// ...
},
}
```
License
-------
GPLv3 or later. See full text in the [COPYING](COPYING) file

2276
example/package-lock.json generated

File diff suppressed because it is too large Load Diff

17
example/package.json

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
{
"name": "sxml-loader-example",
"version": "1.0.0",
"private": true,
"description": "",
"main": "src/index.js",
"scripts": {
"build": "webpack --mode=development"
},
"author": "Ivan Polyakov",
"license": "MIT",
"devDependencies": {
"html-loader": "^4.2.0",
"html-webpack-plugin": "^5.5.0",
"webpack": "^5.74.0"
}
}

0
example/src/index.js

5
example/src/index.sxml

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
'((html
(head
(title "Hello"))
(body
(h1 "Hello World!"))))

27
example/webpack.config.js

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
module: {
rules: [
{
test: /\.sxml$/,
use: ['html-loader', 'sxml-loader'],
},
],
},
resolveLoader: {
alias: {
'sxml-loader': path.resolve(__dirname, '../src/loader.js'),
},
},
plugins: [
new HtmlWebpackPlugin({
inject: 'body',
scriptLoading: 'blocking',
template: 'src/index.sxml',
filename: 'index.html',
minify: false,
}),
],
}
Loading…
Cancel
Save