-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bundled example for Angular Material
* Add rollup config to bundle the angular material example * Add to examples app Part of #1706
- Loading branch information
1 parent
36e3732
commit 8280881
Showing
5 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>JSON Forms Angular Material RendererSet</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | ||
<link href="indigo-pink.css" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type='text/css'> | ||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,900,700,500,300,100' rel='stylesheet' type='text/css'> | ||
</head> | ||
<body> | ||
<app-root></app-root> | ||
</body> | ||
<script src="bundle.js"></script> | ||
</html> | ||
|
||
<!-- | ||
Copyright 2017-2018 Google Inc. All Rights Reserved. | ||
Use of this source code is governed by an MIT-style license that | ||
can be found in the LICENSE file at http://angular.io/license | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import json from '@rollup/plugin-json'; | ||
import nodeResolve from '@rollup/plugin-node-resolve'; | ||
import replace from '@rollup/plugin-replace'; | ||
import copy from 'rollup-plugin-copy'; | ||
import css from 'rollup-plugin-import-css'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
const config = { | ||
input: 'example/main.ts', | ||
output: { | ||
file: 'example/dist/bundle.js', | ||
format: 'iife', | ||
sourcemap: true | ||
}, | ||
plugins: [ | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify('production'), | ||
preventAssignment: true, // recommended to be set by library to be forward compatible | ||
}), | ||
nodeResolve({ browser: true }), | ||
// Transform mixed because some JsonForms modules use import and require | ||
commonjs({ transformMixedEsModules: true }), | ||
css(), | ||
json(), | ||
typescript({ | ||
tsconfigOverride: { | ||
compilerOptions: { | ||
// Do not emit typescript declarations for our bundled example app | ||
declaration: false | ||
} | ||
}}), | ||
copy({ | ||
targets: [ | ||
{ | ||
src: '../../node_modules/@angular/material/prebuilt-themes/indigo-pink.css', | ||
dest: 'example/dist' | ||
}, | ||
{ | ||
src: 'example/index.bundled.html', | ||
dest: 'example/dist', | ||
rename: () => 'index.html' | ||
} | ||
] | ||
}), | ||
] | ||
} | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters