-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add some webpack plugins to examples/webpack_cli (#640)
- Loading branch information
1 parent
8de2fe6
commit f1423d6
Showing
9 changed files
with
3,748 additions
and
635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const someStyle = style({ display: 'block' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
{ | ||
"name": "webpack_cli_example", | ||
"private": true, | ||
"dependencies": { | ||
"mathjs": "10.6.1", | ||
"webpack-cli": "4.10.0", | ||
"webpack": "5.73.0" | ||
"@vanilla-extract/css": "1.9.2", | ||
"css-loader": "6.7.2", | ||
"mathjs": "11.4.0" | ||
}, | ||
"devDependencies": { | ||
"@vanilla-extract/webpack-plugin": "2.2.0", | ||
"css-loader": "6.7.2", | ||
"mini-css-extract-plugin": "2.7.0", | ||
"webpack": "5.75.0", | ||
"webpack-cli": "5.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,37 @@ | ||
const path = require('path') | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin') | ||
const { VanillaExtractPlugin } = require('@vanilla-extract/webpack-plugin') | ||
|
||
const out_path = path.resolve(__dirname, 'dist') | ||
|
||
module.exports = (webpackEnv = {}) => { | ||
return { | ||
entry: path.join(__dirname, 'index.js'), | ||
// stats: 'verbose', | ||
mode: 'development', | ||
stats: 'detailed', | ||
output: { | ||
filename: 'main.js', | ||
path: out_path, | ||
}, | ||
} | ||
module.exports = { | ||
entry: path.join(__dirname, 'index.js'), | ||
stats: 'verbose', | ||
mode: 'development', | ||
stats: 'detailed', | ||
resolve: { | ||
extensions: ['.js', '.ts'], | ||
}, | ||
devtool: 'source-map', | ||
output: { | ||
filename: 'main.js', | ||
path: out_path, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vanilla\.css$/i, // Targets only CSS files generated by vanilla-extract | ||
use: [ | ||
MiniCssExtractPlugin.loader, | ||
{ | ||
loader: require.resolve('css-loader'), | ||
options: { | ||
url: false, // Required as image imports should be handled via JS/TS import statements | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
plugins: [new VanillaExtractPlugin(), new MiniCssExtractPlugin()], | ||
} |
Oops, something went wrong.