Skip to content
This repository was archived by the owner on Oct 1, 2022. It is now read-only.

Commit 031b8f4

Browse files
Fix/dev build (#127)
* broken * x * make webpack work * semi working * compilation should work * building works * split webpack configuration * fix build (somehow) push push push * tweaks * x * cleanup after ourselves * x * watch mode on dev Co-authored-by: Jamie <ijamespine@me.com>
1 parent 0ae6fc5 commit 031b8f4

13 files changed

Lines changed: 9333 additions & 26119 deletions

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
please do NOT change any config files without consulting Jamie first! Thanks :P
2+
3+
handy command to remove accidental build files in lib
4+
5+
```
6+
rm -f lib/**/*.(js|js.map)
7+
```

config/tsconfig.dev.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../dist",
5+
"declaration": true,
6+
"declarationDir": "../dist"
7+
}
8+
}

config/tsconfig.prod.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"declarationDir": "../declarations"
6+
}
7+
}

config/webpack.config.dev.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const base = require('../webpack.config');
2+
3+
module.exports = {
4+
...base('dev'),
5+
name: 'dev',
6+
mode: 'development',
7+
devtool: 'inline-source-map',
8+
watch: true,
9+
entry: {
10+
index: './lib/index.ts',
11+
next: './lib/next'
12+
},
13+
plugins: []
14+
};

config/webpack.config.prod.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const base = require('../webpack.config');
2+
const dts = require('dts-bundle-webpack');
3+
const TerserPlugin = require('terser-webpack-plugin');
4+
5+
module.exports = {
6+
...base('prod'),
7+
name: 'build',
8+
mode: 'production',
9+
devtool: 'hidden-source-map',
10+
entry: {
11+
index: './lib/index.ts',
12+
next: './lib/next'
13+
},
14+
optimization: {
15+
minimize: true,
16+
minimizer: [
17+
new TerserPlugin({
18+
terserOptions: {
19+
keep_classnames: true,
20+
keep_fnames: true
21+
}
22+
})
23+
]
24+
},
25+
plugins: [
26+
new dts({
27+
name: 'pulse-framework',
28+
main: 'declarations/index.d.ts',
29+
out: '../dist/index.d.ts'
30+
}),
31+
new dts({
32+
name: 'pulse-framework/next',
33+
main: 'declarations/next/index.d.ts',
34+
out: '../../dist/next.d.ts'
35+
})
36+
]
37+
};

0 commit comments

Comments
 (0)