Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webpack config #34

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [18.13.0]

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v5

- name: Test and build with node ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup GIT user
uses: fregante/setup-git-user@v1

- run: yarn install --frozen-lockfile
- run: yarn build

Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.3.1]

node-version: [18.13.0]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup GIT user
uses: fregante/setup-git-user@v1

uses: actions/checkout@v4
- name: Run tests with Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g yarn
- run: yarn install
# - run: yarn test-ci
- run: yarn test-ci
- run: yarn build
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
},
"version": "1.0.4",
"scripts": {
"start": "webpack-dev-server",
"build-dev": "webpack",
"build": "webpack -p",
"start": "mwdk-start",
"build": "mwdk-build-prod",
"build-dev": "mwdk-build-dev",
"test": "TZ='America/New_York' jest --verbose",
"test-ci": "TZ='America/New_York' CI=true jest --ci --useStderr --coverage --coverageReporters text-summary cobertura"
},
Expand All @@ -17,7 +17,7 @@
"angular-material": "1.0.0",
"angular-mocks": "1.6.9",
"jest": "^23.6.0",
"materia-widget-development-kit": "^2.5.2"
"materia-widget-development-kit": "~3.0.0"
},
"jest": {
"coverageReporters": [
Expand Down
19 changes: 11 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ const widgetWebpack = require('materia-widget-development-kit/webpack-widget')

const copy = widgetWebpack.getDefaultCopyList()
const defaultRules = widgetWebpack.getDefaultRules()
const srcPath = path.join(__dirname, 'src')

const entries = {
'creator.js':['./src/creator.js'],
'creator.css':['./src/creator.html','./src/creator.scss'],
'player.js':['./src/player.js'],
'player.css':['./src/player.html','./src/player.scss'],
'guides/creator.temp.html':['./src/_guides/creator.md'],
'guides/player.temp.html':['./src/_guides/player.md']
'player': [
path.join(srcPath, 'player.html'),
path.join(srcPath, 'player.js'),
path.join(srcPath, 'player.scss')
],
'creator': [
path.join(srcPath, 'creator.html'),
path.join(srcPath, 'creator.js'),
path.join(srcPath, 'creator.scss')
]
}

const customCopy = copy.concat([
Expand Down Expand Up @@ -42,11 +47,9 @@ const babelLoaderWithPolyfillRule = {

const customRules = [
babelLoaderWithPolyfillRule,
defaultRules.loadAndPrefixCSS,
defaultRules.loadAndPrefixSASS,
defaultRules.loadHTMLAndReplaceMateriaScripts,
defaultRules.copyImages,
defaultRules.loadAndCompileMarkdown
]

let options = {
Expand Down
Loading
Loading