Skip to content

Commit 5efafeb

Browse files
update to lit 2 and webpack 5
1 parent b684112 commit 5efafeb

File tree

6 files changed

+1829
-2207
lines changed

6 files changed

+1829
-2207
lines changed

package.json

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,39 @@
55
"main": "index.html",
66
"scripts": {
77
"build": "webpack --mode production",
8-
"dev": "webpack-dev-server --mode development"
8+
"dev": "webpack serve --mode development"
99
},
1010
"dependencies": {
11-
"@conectate/ct-lit": "^1.1.1",
12-
"@conectate/ct-router": "^2.2.0",
13-
"@webcomponents/webcomponentsjs": "^2.4.4",
14-
"lit-element": "^2.4.0"
11+
"@babel/plugin-proposal-export-default-from": "^7.12.13",
12+
"@conectate/ct-lit": "^3.1.0",
13+
"@conectate/ct-router": "^3.1.0",
14+
"@webcomponents/webcomponentsjs": "^2.5.0",
15+
"lit": "^2.0.0-rc.1"
1516
},
1617
"devDependencies": {
17-
"@babel/core": "^7.10.0",
18-
"@babel/plugin-proposal-logical-assignment-operators": "^7.10.4",
19-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
20-
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
18+
"@babel/core": "^7.14.0",
19+
"@babel/plugin-proposal-logical-assignment-operators": "^7.13.8",
20+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8",
21+
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
2122
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
22-
"@babel/plugin-syntax-import-meta": "^7.8.3",
23-
"@babel/plugin-transform-async-to-generator": "^7.8.3",
24-
"@babel/plugin-transform-runtime": "^7.10.0",
25-
"@babel/preset-env": "^7.10.0",
23+
"@babel/plugin-syntax-import-meta": "^7.10.4",
24+
"@babel/plugin-transform-async-to-generator": "^7.13.0",
25+
"@babel/plugin-transform-runtime": "^7.13.15",
26+
"@babel/preset-env": "^7.14.1",
2627
"@firebase/app-types": "^0.6.1",
27-
"babel-loader": "^8.0.5",
28+
"babel-loader": "^8.2.2",
2829
"babel-plugin-bundled-import-meta": "^0.3.2",
2930
"babel-plugin-template-html-minifier": "^4.1.0",
30-
"clean-webpack-plugin": "^3.0.0",
31+
"clean-webpack-plugin": "^4.0.0-alpha.0",
3132
"copy-webpack-plugin": "5.0.3",
32-
"html-webpack-plugin": "^4.3.0",
33-
"prettier": "^2.0.5",
33+
"html-webpack-plugin": "^5.3.1",
34+
"prettier": "^2.2.1",
3435
"svg-inline-loader": "^0.8.0",
35-
"ts-loader": "^6.2.1",
36-
"typescript": "^4.0.0-dev.20200718",
37-
"webpack": "^4.41.2",
38-
"webpack-bundle-analyzer": "^3.6.0",
39-
"webpack-cli": "^3.3.5",
40-
"webpack-dev-server": "^3.9.0"
36+
"ts-loader": "^9.1.2",
37+
"typescript": "^4.2.4",
38+
"webpack": "^5.36.2",
39+
"webpack-bundle-analyzer": "^4.4.1",
40+
"webpack-cli": "^4.6.0",
41+
"webpack-dev-server": "^3.11.2"
4142
}
4243
}

src/base/styles/default-theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css } from 'lit-element';
1+
import { css } from 'lit';
22

33
// Define your Theme
44
let defaultTheme = css`

src/base/styles/lit-shared-styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css } from 'lit-element';
1+
import { css } from 'lit';
22

33
// You Shared Styles
44
export const litStyles = css`

src/lit-app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import './base/app-router';
22
import AppLocalStorage from './base/app-localstorage';
33
import { loadLang } from '../res/values/strings';
4-
import { css, CtLit, customElement, html, property } from '@conectate/ct-lit';
4+
import { css, CtLit, customElement, html } from '@conectate/ct-lit';
5+
import { property, query, queryAll, queryAssignedNodes, queryAsync, state, state as internalProperty } from 'lit/decorators.js';
56
import { injectTheme, Theme } from './base/styles/default-theme';
67

78
@customElement('lit-app')

webpack.config.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = (env, options) => {
2626
'@babel/plugin-proposal-logical-assignment-operators',
2727
'@babel/plugin-transform-runtime',
2828
'@babel/plugin-transform-async-to-generator',
29+
'@babel/plugin-proposal-export-default-from',
2930
[
3031
'template-html-minifier',
3132
{
@@ -60,11 +61,14 @@ module.exports = (env, options) => {
6061
devtool: development ? 'source-map' : undefined,
6162
resolve: {
6263
// Add '.ts' and '.tsx' as resolvable extensions.
63-
extensions: ['.ts', '.js', '.json']
64+
extensions: ['.ts', '.js', '.json'],
65+
alias: {
66+
'lit/decorators': 'lit/decorators.js'
67+
}
6468
},
6569
plugins: [
6670
new webpack.DefinePlugin({
67-
'process.env.NODE_ENV': JSON.stringify(development ? 'dev' : 'production')
71+
'process.env.NODE_EN': JSON.stringify(development ? 'dev' : 'production')
6872
}),
6973
new CleanWebpackPlugin(),
7074
new HtmlWebpackPlugin({
@@ -91,8 +95,7 @@ module.exports = (env, options) => {
9195
comments: false
9296
}
9397
},
94-
parallel: true,
95-
sourceMap: true
98+
parallel: true
9699
})
97100
].filter(_ => !!_)
98101
},
@@ -116,7 +119,13 @@ module.exports = (env, options) => {
116119
{
117120
test: /\.svg$/,
118121
loader: 'svg-inline-loader'
119-
}
122+
},
123+
{
124+
test: /\.m?js/,
125+
resolve: {
126+
fullySpecified: false
127+
}
128+
},
120129
]
121130
},
122131
devServer: {

0 commit comments

Comments
 (0)