Skip to content

Commit

Permalink
feat: remove virtual module plugin, much refactoring, webpack 5 support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drops support for Marko 4 compilation
  • Loading branch information
DylanPiercey committed Jan 30, 2021
1 parent 27cfdf8 commit 4b745eb
Show file tree
Hide file tree
Showing 92 changed files with 11,585 additions and 9,408 deletions.
15 changes: 10 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
module.exports = {
root: true,
env: {
node: true
node: true,
},
parserOptions: {
project: ["tsconfig.json"]
project: ["tsconfig.json"],
},
extends: [
"eslint:recommended",
"plugin:jest/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier/@typescript-eslint"
"prettier/@typescript-eslint",
],
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-use-before-define": "off"
}
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-call": "off",
},
};
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,26 @@ export default [
rules: [
{
test: /\.marko$/,
loader: "@marko/webpack/loader"
}
]
loader: "@marko/webpack/loader",
},
],
},
plugins: [markoPlugin.server]
plugins: [markoPlugin.server],
},
{
rules: [
{
test: /\.marko$/,
loader: "@marko/webpack/loader"
loader: "@marko/webpack/loader",
},
// If using `style` blocks with Marko you must use an appropriate loader
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
use: ["style-loader", "css-loader"],
},
],
plugins: [markoPlugin.browser]
}
plugins: [markoPlugin.browser],
},
];
```

Expand Down Expand Up @@ -136,7 +136,7 @@ import I18nPlugin from "i18n-webpack-plugin";

const languages = {
en: null,
de: require("./de.json")
de: require("./de.json"),
};

const markoPlugin = new MarkoPlugin();
Expand All @@ -149,27 +149,27 @@ export default [
rules: [
{
test: /\.marko$/,
loader: "@marko/webpack/loader"
}
]
loader: "@marko/webpack/loader",
},
],
},
plugins: [markoPlugin.server]
plugins: [markoPlugin.server],
},
...Object.keys(languages).map(language => ({
...Object.keys(languages).map((language) => ({
name: `Browser-${language}`,
rules: [
{
test: /\.marko$/,
loader: "@marko/webpack/loader"
loader: "@marko/webpack/loader",
},
// If using `style` blocks with Marko you must use an appropriate loader
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
use: ["style-loader", "css-loader"],
},
],
plugins: [new I18nPlugin(languages[language]), markoPlugin.browser]
}))
plugins: [new I18nPlugin(languages[language]), markoPlugin.browser],
})),
];
```

Expand Down Expand Up @@ -198,7 +198,7 @@ This plugin exposes a `runtimeId` option produces output that automatically sets
import MarkoPlugin from "@marko/webpack/plugin";

const markoPlugin = new MarkoPlugin({
runtimeId: "MY_MARKO_RUNTIME_ID"
runtimeId: "MY_MARKO_RUNTIME_ID",
});
```

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ module.exports = {
preset: "ts-jest",
testEnvironment: "node",
testRegex: `/__tests__/[^./]+\\.ts$`,
coveragePathIgnorePatterns: ["/__tests__/"]
coveragePathIgnorePatterns: ["/__tests__/"],
};
Loading

0 comments on commit 4b745eb

Please sign in to comment.