Skip to content

Commit

Permalink
fix(build): vscode chrome debugger + webpack prod build should both work
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding-SE committed Mar 17, 2020
1 parent 6c3ab52 commit e148090
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 94 deletions.
73 changes: 0 additions & 73 deletions packages/common/.vscode/launch.json

This file was deleted.

9 changes: 7 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
"name": "@slickgrid-universal/common",
"version": "0.0.2",
"description": "SlickGrid-Universal Common Code",
"main": "src/index.ts",
"typings": "dist/es2020/index.d.ts",
"browser": "src/index.ts",
"main": "dist/es2015/index.js",
"typings": "dist/es2015/index.d.ts",
"author": "Ghislain B.",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"files": [
"src",
"dist"
],
"scripts": {
"build": "cross-env tsc --build",
"build:watch": "cross-env tsc --incremental --watch",
Expand Down
6 changes: 3 additions & 3 deletions packages/common/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"module": "es2015",
"module": "es2020",
"moduleResolution": "node",
"target": "es5",
"target": "es2015",
"lib": [
"es2017",
"es2020",
"dom"
],
"typeRoots": [
Expand Down
6 changes: 3 additions & 3 deletions packages/common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compileOnSave": false,
"compilerOptions": {
"rootDir": "src",
"declarationDir": "dist/es2020",
"outDir": "dist/es2020",
"declarationDir": "dist/es2015",
"outDir": "dist/es2015",
"target": "es2017",
"module": "es2015",
"sourceMap": true,
Expand Down Expand Up @@ -37,4 +37,4 @@
"src/**/*.ts",
"src/typings/**/*.ts"
]
}
}
10 changes: 6 additions & 4 deletions packages/vanilla-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"name": "@slickgrid-universal/vanilla-bundle",
"version": "0.0.2",
"description": "Vanilla Slick Grid Bundle - Framework agnostic the output is to be used in vanilla JS/TS - Written in TypeScript and we also use WebPack to bundle everything into 1 JS file.",
"browser": "src/index.ts",
"main": "src/index.ts",
"typings": "dist/es2020/index.d.ts",
"directories": {
"src": "src"
},
"typings": "dist/es2015/index.d.ts",
"files": [
"src",
"dist"
],
"scripts": {
"test": "echo testing slickgrid-universal slickgrid-vanilla-bundle code",
"dev": "webpack --env.development",
Expand Down
6 changes: 3 additions & 3 deletions packages/vanilla-bundle/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"module": "es2015",
"module": "es2020",
"moduleResolution": "node",
"target": "es5",
"target": "es2015",
"lib": [
"es2017",
"es2020",
"dom"
],
"typeRoots": [
Expand Down
4 changes: 2 additions & 2 deletions packages/vanilla-bundle/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compileOnSave": false,
"compilerOptions": {
"rootDir": "src",
"declarationDir": "dist/es2020",
"outDir": "dist/es2020",
"declarationDir": "dist/es2015",
"outDir": "dist/es2015",
"target": "es2017",
"module": "es2015",
"sourceMap": true,
Expand Down
9 changes: 5 additions & 4 deletions packages/vanilla-bundle/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,28 @@ const outDir = path.resolve(__dirname, 'dist');
const srcDir = path.resolve(__dirname, 'src');
const nodeModulesDir = path.resolve(__dirname, 'node_modules');

module.exports = ({ production } = {}, { port, host } = {}) => ({
module.exports = ({ production } = {}) => ({
mode: production ? 'production' : 'development',
entry: {
app: [`${srcDir}/index.ts`],
},
stats: {
warnings: false
},
devtool: production ? 'nosources-source-map' : 'cheap-module-eval-source-map',
output: {
path: `${outDir}/bundle`,
publicPath: baseUrl,
filename: production ? 'slickgrid-vanilla-bundle.js' : 'slickgrid-vanilla-bundle.js',
sourceMapFilename: production ? 'slickgrid-vanilla-bundle.map' : 'slickgrid-vanilla-bundle.map',
filename: 'slickgrid-vanilla-bundle.js',
sourceMapFilename: 'slickgrid-vanilla-bundle.map',
libraryTarget: 'umd',
library: 'MyLib',
umdNamedDefine: true
},
resolve: {
extensions: ['.ts', '.js'],
modules: [srcDir, 'node_modules'],
mainFields: production ? ['module', 'main'] : ['browser', 'module'],
alias: {
moment$: 'moment/moment.js'
}
Expand All @@ -38,5 +40,4 @@ module.exports = ({ production } = {}, { port, host } = {}) => ({
{ test: /\.ts?$/, use: 'ts-loader', exclude: nodeModulesDir, },
],
},
devtool: production ? 'nosources-source-map' : 'cheap-module-eval-source-map',
});

0 comments on commit e148090

Please sign in to comment.