Skip to content

Commit

Permalink
tests: Add snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh1990 committed Jun 13, 2020
1 parent 72bb05d commit a1f29ef
Show file tree
Hide file tree
Showing 52 changed files with 74,848 additions and 63 deletions.
18 changes: 18 additions & 0 deletions examples/antd/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "react",
"version": "1.0.0",
"main": "index.js",
"license": "UNLICENSED",
"private": true,
"dependencies": {
"antd": "^4.3.3",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@types/react": "^16.9.36",
"@types/react-dom": "^16.9.8",
"ts-node": "^8.10.2",
"typescript": "^3.9.5"
}
}
17 changes: 17 additions & 0 deletions examples/antd/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { PureComponent } from 'react';
import ReactDom from 'react-dom';
import { Button, Tag } from 'antd';

class Demo extends PureComponent {
render() {
return (
<>
<div>Hello World</div>
<Button>Button</Button>
<Tag>Tags</Tag>
</>
);
}
}

ReactDom.render(<Demo />, document.getElementById('root'));
3 changes: 3 additions & 0 deletions examples/antd/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json",
}
13 changes: 13 additions & 0 deletions examples/antd/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import path from 'path';
import webpackGenius from '../../src';


export default webpackGenius(Number(process.env.PORT || 5000), (genius) => {
genius
.output((output) => {
output.path = path.join(__dirname.replace('examples', 'snapshots'), genius.getEnvironment());
})
.optimization((optimization) => {
optimization.minimize = genius.getEnvironment() === 'production';
});
});
Loading

0 comments on commit a1f29ef

Please sign in to comment.